com.twitter.common.net.pool
Interface Connection<T,E>

All Superinterfaces:
Closeable, Supplier<T>
All Known Implementing Classes:
TTransportConnection

public interface Connection<T,E>
extends Supplier<T>, Closeable

An interface to a connection resource that may become invalid.


Method Summary
 void close()
          Closes this connection.
 T get()
          This will always be the same underlying connection for the lifetime of this object.
 E getEndpoint()
           
 boolean isValid()
           
 

Method Detail

get

T get()
This will always be the same underlying connection for the lifetime of this object.

Specified by:
get in interface Supplier<T>
Returns:
the connection

isValid

boolean isValid()
Returns:
true if the supplied connection is valid for use.

close

void close()
Closes this connection.

Specified by:
close in interface Closeable

getEndpoint

E getEndpoint()
Returns:
the endpoint this connection is connected to.