com.netflix.astyanax.connectionpool
Interface Connection<CL>

Type Parameters:
CL -

public interface Connection<CL>

Interface to an instance of a connection on a host.

Author:
elandau

Nested Class Summary
static interface Connection.AsyncOpenCallback<CL>
           
 
Method Summary
 void close()
          Shut down the connection.
<R> OperationResult<R>
execute(Operation<CL,R> op)
          Execute an operation on the connection and return a result
 Host getHost()
          Get the host for this connection
 HostConnectionPool<CL> getHostConnectionPool()
          Get the parent host connection pool.
 ConnectionException getLastException()
          Get the last exception that caused the connection to be closed
 long getOperationCount()
          Number of operations performed on this connections since it was opened
 void open()
          Open a new connection
 void openAsync(Connection.AsyncOpenCallback<CL> callback)
          Open a connection asynchronously and call the callback on connection or failure
 

Method Detail

execute

<R> OperationResult<R> execute(Operation<CL,R> op)
                           throws ConnectionException
Execute an operation on the connection and return a result

Type Parameters:
R -
Parameters:
op -
Returns:
Throws:
ConnectionException

close

void close()
Shut down the connection. isOpen() will now return false.


getHostConnectionPool

HostConnectionPool<CL> getHostConnectionPool()
Get the parent host connection pool.

Returns:

getHost

Host getHost()
Get the host for this connection

Returns:

getLastException

ConnectionException getLastException()
Get the last exception that caused the connection to be closed

Returns:

open

void open()
          throws ConnectionException
Open a new connection

Throws:
ConnectionException

openAsync

void openAsync(Connection.AsyncOpenCallback<CL> callback)
Open a connection asynchronously and call the callback on connection or failure

Parameters:
callback -

getOperationCount

long getOperationCount()
Number of operations performed on this connections since it was opened

Returns:


Copyright © 2012. All Rights Reserved.