@ThreadSafe public class BasicNIOConnPool extends AbstractNIOConnPool<HttpHost,NHttpClientConnection,BasicNIOPoolEntry>
ConnPool implementation that represents a pool
of non-blocking NHttpClientConnection connections identified by
an HttpHost instance. Please note this pool implementation
does not support complex routes via a proxy cannot differentiate between
direct and proxied connections.
The following parameters can be used to customize the behavior of this class:
HttpHost| Constructor and Description |
|---|
BasicNIOConnPool(ConnectingIOReactor ioreactor,
HttpParams params) |
BasicNIOConnPool(ConnectingIOReactor ioreactor,
NIOConnFactory<HttpHost,NHttpClientConnection> connFactory,
HttpParams params) |
| Modifier and Type | Method and Description |
|---|---|
protected BasicNIOPoolEntry |
createEntry(HttpHost host,
NHttpClientConnection conn) |
Future<BasicNIOPoolEntry> |
lease(HttpHost route,
Object state) |
Future<BasicNIOPoolEntry> |
lease(HttpHost route,
Object state,
FutureCallback<BasicNIOPoolEntry> callback)
Attempts to lease a connection for the given route and with the given
state from the pool.
|
protected SocketAddress |
resolveLocalAddress(HttpHost host) |
protected SocketAddress |
resolveRemoteAddress(HttpHost host) |
closeExpired, closeIdle, getDefaultMaxPerRoute, getMaxPerRoute, getMaxTotal, getStats, getTotalStats, isShutdown, lease, release, requestCancelled, requestCompleted, requestFailed, requestTimeout, setDefaultMaxPerRoute, setMaxPerRoute, setMaxTotal, shutdown, toString, validatePendingRequestspublic BasicNIOConnPool(ConnectingIOReactor ioreactor, NIOConnFactory<HttpHost,NHttpClientConnection> connFactory, HttpParams params)
public BasicNIOConnPool(ConnectingIOReactor ioreactor, HttpParams params)
protected SocketAddress resolveRemoteAddress(HttpHost host)
resolveRemoteAddress in class AbstractNIOConnPool<HttpHost,NHttpClientConnection,BasicNIOPoolEntry>protected SocketAddress resolveLocalAddress(HttpHost host)
resolveLocalAddress in class AbstractNIOConnPool<HttpHost,NHttpClientConnection,BasicNIOPoolEntry>protected BasicNIOPoolEntry createEntry(HttpHost host, NHttpClientConnection conn)
createEntry in class AbstractNIOConnPool<HttpHost,NHttpClientConnection,BasicNIOPoolEntry>public Future<BasicNIOPoolEntry> lease(HttpHost route, Object state, FutureCallback<BasicNIOPoolEntry> callback)
ConnPoollease in interface ConnPool<HttpHost,BasicNIOPoolEntry>lease in class AbstractNIOConnPool<HttpHost,NHttpClientConnection,BasicNIOPoolEntry>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 Future<BasicNIOPoolEntry> lease(HttpHost route, Object state)
lease in class AbstractNIOConnPool<HttpHost,NHttpClientConnection,BasicNIOPoolEntry>Copyright © 2005-2016 The Apache Software Foundation. All Rights Reserved.