@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.HttpHost
Constructor and Description |
---|
BasicNIOConnPool(ConnectingIOReactor ioreactor) |
BasicNIOConnPool(ConnectingIOReactor ioreactor,
ConnectionConfig config) |
BasicNIOConnPool(ConnectingIOReactor ioreactor,
HttpParams params)
Deprecated.
|
BasicNIOConnPool(ConnectingIOReactor ioreactor,
int connectTimeout,
ConnectionConfig config) |
BasicNIOConnPool(ConnectingIOReactor ioreactor,
NIOConnFactory<HttpHost,NHttpClientConnection> connFactory,
HttpParams params)
Deprecated.
|
BasicNIOConnPool(ConnectingIOReactor ioreactor,
NIOConnFactory<HttpHost,NHttpClientConnection> connFactory,
int connectTimeout) |
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 void |
onLease(BasicNIOPoolEntry entry) |
protected void |
onRelease(BasicNIOPoolEntry entry) |
protected SocketAddress |
resolveLocalAddress(HttpHost host)
Deprecated.
(4.3) use
SocketAddressResolver |
protected SocketAddress |
resolveRemoteAddress(HttpHost host)
Deprecated.
(4.3) use
SocketAddressResolver |
closeExpired, closeIdle, enumAvailable, enumEntries, enumLeased, getDefaultMaxPerRoute, getMaxPerRoute, getMaxTotal, getRoutes, getStats, getTotalStats, isShutdown, lease, lease, onReuse, release, requestCancelled, requestCompleted, requestFailed, requestTimeout, setDefaultMaxPerRoute, setMaxPerRoute, setMaxTotal, shutdown, toString, validatePendingRequests
@Deprecated public BasicNIOConnPool(ConnectingIOReactor ioreactor, NIOConnFactory<HttpHost,NHttpClientConnection> connFactory, HttpParams params)
BasicNIOConnPool(ConnectingIOReactor, NIOConnFactory, int)
@Deprecated public BasicNIOConnPool(ConnectingIOReactor ioreactor, HttpParams params)
BasicNIOConnPool(ConnectingIOReactor,
ConnectionConfig)
public BasicNIOConnPool(ConnectingIOReactor ioreactor, NIOConnFactory<HttpHost,NHttpClientConnection> connFactory, int connectTimeout)
public BasicNIOConnPool(ConnectingIOReactor ioreactor, int connectTimeout, ConnectionConfig config)
public BasicNIOConnPool(ConnectingIOReactor ioreactor, ConnectionConfig config)
public BasicNIOConnPool(ConnectingIOReactor ioreactor)
@Deprecated protected SocketAddress resolveRemoteAddress(HttpHost host)
SocketAddressResolver
resolveRemoteAddress
in class AbstractNIOConnPool<HttpHost,NHttpClientConnection,BasicNIOPoolEntry>
@Deprecated protected SocketAddress resolveLocalAddress(HttpHost host)
SocketAddressResolver
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)
ConnPool
lease
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>
protected void onLease(BasicNIOPoolEntry entry)
onLease
in class AbstractNIOConnPool<HttpHost,NHttpClientConnection,BasicNIOPoolEntry>
protected void onRelease(BasicNIOPoolEntry entry)
onRelease
in class AbstractNIOConnPool<HttpHost,NHttpClientConnection,BasicNIOPoolEntry>
Copyright © 2005–2015 The Apache Software Foundation. All rights reserved.