ClientConnectionPoolManager maintains a pool of
ManagedHttpClientConnections and is able to service connection requests
from multiple execution threads. Connections are pooled on a per route
basis. A request for a route which already the manager has persistent
connections for available in the pool will be serviced by leasing
a connection from the pool rather than creating a new connection.
ClientConnectionPoolManager maintains a maximum limit of connection
on a per route basis and in total. Connection limits, however, can be adjusted
using ConnPoolControl methods.
Total time to live (TTL) set at construction time defines maximum life span of persistent connections regardless of their expiration setting. No persistent connection will be re-used past its TTL value.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class |
| Modifier and Type | Field and Description |
|---|---|
| private final AtomicBoolean | |
| private volatile Resolver | |
| private final HttpClientConnectionOperator | |
| private final HttpConnectionFactory | |
| public static final int | |
| public static final int | |
| private static final PrefixedIncrementingId | |
| private static final Logger | |
| private final ManagedConnPool | |
| private volatile Resolver | |
| private volatile Resolver |
| Modifier and Type | Method and Description |
|---|---|
| private PoolingHttpClientConnectionManager. | |
| public void | close()
Implements java. |
| public void | close(final CloseMode
How to close the receiver. closeMode)Implements org. |
| public void | |
| public void | |
| pack-priv void | |
| public void | connect(final ConnectionEndpoint
the managed endpoint. endpoint, final TimeValue connect timeout. timeout, final HttpContext the actual HTTP context. context)Implements org. |
| public int | |
| public SocketConfig | |
| public int | getMaxPerRoute(final HttpRoute route)
Implements org. |
| public int | |
| public Set | |
| public PoolStats | |
| public PoolStats | |
| public TimeValue | |
| public LeaseRequest | |
| public LeaseRequest | lease(final String
unique operation ID or id, final HttpRoute null.HTTP route of the requested connection. route, final Timeout lease request timeout. requestTimeout, final Object expected state of the connection or state)null
if the connection is not expected to carry any state.Implements org. LeaseRequest object which can be used to obtain
a ConnectionEndpoint to cancel the request by calling
LeaseRequest#cancel().
|
| public void | release(final ConnectionEndpoint
the managed endpoint. endpoint, final Object the new connection state of state, final TimeValue null if state-less.the duration of time this connection is valid for reuse. keepAlive)Implements org. |
| private ConnectionConfig | |
| private SocketConfig | |
| private TlsConfig | |
| private TimeValue | |
| public void | setConnectionConfigResolver(final Resolver<HttpRoute, ConnectionConfig> connectionConfigResolver)
Sets |
| public void | setDefaultConnectionConfig(final ConnectionConfig config)
Sets the same |
| public void | setDefaultMaxPerRoute(final int max)
Implements org. |
| public void | |
| public void | |
| public void | setMaxPerRoute(final HttpRoute route, final int max)
Implements org. |
| public void | |
| public void | setSocketConfigResolver(final Resolver<HttpRoute, SocketConfig> socketConfigResolver)
Sets |
| public void | |
| public void | setValidateAfterInactivity(final TimeValue validateAfterInactivity)
Deprecated
Use
Defines period of inactivity after which persistent connections must
be re-validated prior to being setConnectionConfigResolver(Resolver).
lease(String, HttpRoute, Object) leased} to the consumer.
|
| public void | upgrade(final ConnectionEndpoint
the managed endpoint. endpoint, final HttpContext the actual HTTP context. context)Implements org. |