T - routeC - connection objectE - pool entry@Contract(threading=SAFE_CONDITIONAL) public abstract class AbstractNIOConnPool<T,C,E extends PoolEntry<T,C>> extends Object implements ConnPool<T,E>, ConnPoolControl<T>
| Constructor and Description |
|---|
AbstractNIOConnPool(ConnectingIOReactor ioreactor,
NIOConnFactory<T,C> connFactory,
int defaultMaxPerRoute,
int maxTotal)
|
AbstractNIOConnPool(ConnectingIOReactor ioreactor,
NIOConnFactory<T,C> connFactory,
SocketAddressResolver<T> addressResolver,
int defaultMaxPerRoute,
int maxTotal) |
| Modifier and Type | Method and Description |
|---|---|
void |
closeExpired() |
void |
closeIdle(long idletime,
TimeUnit tunit) |
int |
getDefaultMaxPerRoute() |
int |
getMaxPerRoute(T route) |
int |
getMaxTotal() |
Set<T> |
getRoutes()
Returns snapshot of all knows routes
|
PoolStats |
getStats(T route) |
PoolStats |
getTotalStats() |
boolean |
isShutdown() |
Future<E> |
lease(T route,
Object state) |
Future<E> |
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.
|
Future<E> |
lease(T route,
Object state,
long connectTimeout,
long leaseTimeout,
TimeUnit tunit,
FutureCallback<E> callback) |
Future<E> |
lease(T route,
Object state,
long connectTimeout,
TimeUnit tunit,
FutureCallback<E> callback) |
void |
release(E entry,
boolean reusable)
Releases the pool entry back to the pool.
|
void |
setDefaultMaxPerRoute(int max) |
void |
setMaxPerRoute(T route,
int max) |
void |
setMaxTotal(int max) |
void |
shutdown(long waitMs) |
String |
toString() |
void |
validatePendingRequests() |
@Deprecated public AbstractNIOConnPool(ConnectingIOReactor ioreactor, NIOConnFactory<T,C> connFactory, int defaultMaxPerRoute, int maxTotal)
public AbstractNIOConnPool(ConnectingIOReactor ioreactor, NIOConnFactory<T,C> connFactory, SocketAddressResolver<T> addressResolver, int defaultMaxPerRoute, int maxTotal)
public boolean isShutdown()
public void shutdown(long waitMs)
throws IOException
IOExceptionpublic Future<E> lease(T route, Object state, long connectTimeout, TimeUnit tunit, FutureCallback<E> callback)
public Future<E> lease(T route, Object state, long connectTimeout, long leaseTimeout, TimeUnit tunit, FutureCallback<E> callback)
public Future<E> lease(T route, Object state, FutureCallback<E> callback)
ConnPoollease in interface ConnPool<T,E extends PoolEntry<T,C>>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 null.callback - operation completion callback.public void release(E entry, boolean reusable)
ConnPoolpublic void validatePendingRequests()
public void setMaxTotal(int max)
setMaxTotal in interface ConnPoolControl<T>public int getMaxTotal()
getMaxTotal in interface ConnPoolControl<T>public void setDefaultMaxPerRoute(int max)
setDefaultMaxPerRoute in interface ConnPoolControl<T>public int getDefaultMaxPerRoute()
getDefaultMaxPerRoute in interface ConnPoolControl<T>public void setMaxPerRoute(T route, int max)
setMaxPerRoute in interface ConnPoolControl<T>public int getMaxPerRoute(T route)
getMaxPerRoute in interface ConnPoolControl<T>public PoolStats getTotalStats()
getTotalStats in interface ConnPoolControl<T>public PoolStats getStats(T route)
getStats in interface ConnPoolControl<T>public void closeIdle(long idletime,
TimeUnit tunit)
public void closeExpired()
Copyright © 2010 - 2020 Adobe. All Rights Reserved