PoolingAsyncClientConnectionManager maintains a pool of non-blocking
org.apache.hc.core5.http.HttpConnection s 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 services by leasing
a connection from the pool rather than creating a new connection.
PoolingAsyncClientConnectionManager maintains a maximum limit
of connection on a per route basis and in total. Connection limits
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 AsyncClientConnectionOperator | |
| public static final int | |
| public static final int | |
| private static final PrefixedIncrementingId | |
| private static final Logger | |
| private final ManagedConnPool | |
| private volatile Resolver |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | PoolingAsyncClientConnectionManager(final Lookup<TlsStrategy> tlsStrategyLookup, final PoolConcurrencyPolicy poolConcurrencyPolicy, final TimeValue timeToLive)
|
| public | PoolingAsyncClientConnectionManager(final Lookup<TlsStrategy> tlsStrategyLookup, final PoolConcurrencyPolicy poolConcurrencyPolicy, final PoolReusePolicy poolReusePolicy, final TimeValue timeToLive)
|
| public | PoolingAsyncClientConnectionManager(final Lookup<TlsStrategy> tlsStrategyLookup, final PoolConcurrencyPolicy poolConcurrencyPolicy, final PoolReusePolicy poolReusePolicy, final TimeValue timeToLive, final SchemePortResolver schemePortResolver, final DnsResolver dnsResolver)
|
| protected | PoolingAsyncClientConnectionManager(final AsyncClientConnectionOperator connectionOperator, final PoolConcurrencyPolicy poolConcurrencyPolicy, final PoolReusePolicy poolReusePolicy, final TimeValue timeToLive)
|
| protected | PoolingAsyncClientConnectionManager(final ManagedConnPool<HttpRoute, ManagedAsyncClientConnection> pool, final AsyncClientConnectionOperator connectionOperator)
|
| Modifier and Type | Method and Description |
|---|---|
| private PoolingAsyncClientConnectionManager. | |
| 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 Future | connect(final AsyncConnectionEndpoint
the managed endpoint. endpoint, final ConnectionInitiator connectionInitiator, final Timeout connect timeout. timeout, final Object connect request attachment. attachment, final HttpContext the actual HTTP context. context, final FutureCallback<AsyncConnectionEndpoint> result callback. callback)Implements org. |
| public int | |
| public int | getMaxPerRoute(final HttpRoute route)
Implements org. |
| public int | |
| public Set | |
| public PoolStats | |
| public PoolStats | |
| public TimeValue | |
| pack-priv boolean | Returns: true if the connection manager has been shut down and is closed, otherwise
return false.Method that can be called to determine whether the connection manager has been shut down and is closed or not. |
| public Future | lease(final String
unique operation ID or id, final HttpRoute null.HTTP route of the requested connection. route, final Object expected state of the connection or state, final Timeout null
if the connection is not expected to carry any state.lease request timeout. requestTimeout, final FutureCallback<AsyncConnectionEndpoint> result callback. callback)Implements org. Future object which can be used to obtain
an AsyncConnectionEndpoint or to cancel the request by calling
Future#cancel(boolean).
|
| public void | release(final AsyncConnectionEndpoint
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 TlsConfig | |
| 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 | setMaxPerRoute(final HttpRoute route, final int max)
Implements org. |
| public void | |
| 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, Timeout,
FutureCallback) leased} to the consumer.
|
| public void | upgrade(final AsyncConnectionEndpoint
the managed endpoint. endpoint, final Object the attachment the upgrade attachment object. attachment, final HttpContext the actual HTTP context. context, final FutureCallback<AsyncConnectionEndpoint> result callback. callback)Overrides default org. |
| public void | upgrade(final AsyncConnectionEndpoint
the managed endpoint. endpoint, final Object the attachment the upgrade attachment object. attachment, final HttpContext the actual HTTP context. context)Implements org. |