- Type Parameters:
T- the route type that represents the opposite endpoint of a pooled connection.
E- the type of the pool entry containing a pooled connection.
- All Known Implementing Classes:
public interface ConnPool<T,E>
ConnPoolrepresents a shared pool connections can be leased from and released back to.
All Methods Instance Methods Abstract Methods Modifier and Type Method Description
lease(T route, Object state, FutureCallback<E> callback)Attempts to lease a connection for the given route and with the given state from the pool.
release(E entry, boolean reusable)Releases the pool entry back to the pool.
leaseAttempts to lease a connection for the given route and with the given state from the pool.
route- route of the connection.
state- arbitrary object that represents a particular state (usually a security principal or a unique token identifying the user whose credentials have been used while establishing the connection). May be
callback- operation completion callback.
- future for a leased pool entry.
void release(E entry, boolean reusable)Releases the pool entry back to the pool.
entry- pool entry leased from the pool
reusable- flag indicating whether or not the released connection is in a consistent state and is safe for further use.