Deprecated
(4.3) use PoolingHttpClientConnectionManager.
org.apache.http.conn.OperatedClientConnection
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 brand new connection.
PoolingConnectionManager maintains a maximum limit of connection on a per route basis and in total. Per default this implementation will create no more than than 2 concurrent connections per given route and no more 20 connections in total. For many real-world applications these limits may prove too constraining, especially if they use HTTP as a transport protocol for their services. Connection limits, however, can be adjusted using HTTP parameters.
| Modifier and Type | Field and Description |
|---|---|
| private final DnsResolver | dnsResolver
the custom-configured DNS lookup mechanism. |
| private final Log | |
| private final ClientConnectionOperator | operator
Deprecated
as a consequence of
ClientConnectionOperator being deprecated.
|
| private final HttpConnPool | pool
Deprecated
as a consequence of
HttpConnPool being deprecated.
|
| private final SchemeRegistry | schemeRegistry
Deprecated
as a consequence of
SchemeRegistry being deprecated.
|
| Access | Constructor and Description |
|---|---|
| public | PoolingClientConnectionManager(final SchemeRegistry schreg)
Deprecated
as a consequence of
SchemeRegistry being deprecated.
|
| public | PoolingClientConnectionManager(final SchemeRegistry schreg, final DnsResolver dnsResolver)
Deprecated
as a consequence of
SchemeRegistry being deprecated.
|
| public | |
| public | PoolingClientConnectionManager(final SchemeRegistry schemeRegistry, final long timeToLive, final TimeUnit timeUnit)
Deprecated
as a consequence of
SchemeRegistry being deprecated.
|
| public | PoolingClientConnectionManager(final SchemeRegistry schemeRegistry, final long timeToLive, final TimeUnit timeUnit, final DnsResolver dnsResolver)
Deprecated
as a consequence of
SchemeRegistry being deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
| public void | closeExpiredConnections()
Implements org. |
| public void | closeIdleConnections(final long
the idle time of connections to be closed idleTimeout, final TimeUnit the unit for the timeUnit)idletimeImplements org. |
| protected ClientConnectionOperator | Returns: the connection operator to usethe scheme registry. schreg)
Deprecated
as a consequence of
Hook for creating the connection operator.
SchemeRegistry and ClientConnectionOperator being deprecated.
|
| protected void | finalize()
Overrides java. |
| private String | |
| private String | |
| private String | |
| public int | |
| public int | getMaxPerRoute(final HttpRoute route)
Implements org. |
| public int | |
| public SchemeRegistry | getSchemeRegistry()
Implements org.
Deprecated
as a consequence of
Obtains the scheme registry used by this manager.
SchemeRegistry being deprecated.
|
| public PoolStats | |
| public PoolStats | |
| pack-priv ManagedClientConnection | leaseConnection(final Future<HttpPoolEntry> future, final long timeout, final TimeUnit timeUnit)
Deprecated
as a consequence of
ManagedClientConnection being deprecated.
|
| public void | releaseConnection(final ManagedClientConnection
the connection to release conn, final long the duration of time this connection is valid for reuse keepalive, final TimeUnit the unit of time validDuration is measured in timeUnit)Implements org.
Deprecated
as a consequence of
Releases a connection for use by others.
ManagedClientConnection being deprecated.
|
| public ClientConnectionRequest | requestConnection(final HttpRoute route, final Object state)
Implements org.
Deprecated
as a consequence of
Returns a new ClientConnectionRequest being deprecated.
ClientConnectionRequest, from which a
ManagedClientConnection can be obtained or the request can be
aborted.
|
| public void | setDefaultMaxPerRoute(final int max)
Implements org. |
| public void | setMaxPerRoute(final HttpRoute route, final int max)
Implements org. |
| public void | |
| public void | shutdown()
Implements org. |
| dnsResolver | back to summary |
|---|---|
| private final DnsResolver dnsResolver the custom-configured DNS lookup mechanism. | |
| log | back to summary |
|---|---|
| private final Log log | |
| operator | back to summary |
|---|---|
| private final ClientConnectionOperator operator
Deprecated as a consequence of | |
| pool | back to summary |
|---|---|
| private final HttpConnPool pool
Deprecated as a consequence of | |
| schemeRegistry | back to summary |
|---|---|
| private final SchemeRegistry schemeRegistry
Deprecated as a consequence of | |
| PoolingClientConnectionManager | back to summary |
|---|---|
| public PoolingClientConnectionManager(final SchemeRegistry schreg)
Deprecated as a consequence of | |
| PoolingClientConnectionManager | back to summary |
|---|---|
| public PoolingClientConnectionManager(final SchemeRegistry schreg, final DnsResolver dnsResolver)
Deprecated as a consequence of | |
| PoolingClientConnectionManager | back to summary |
|---|---|
| public PoolingClientConnectionManager() | |
| PoolingClientConnectionManager | back to summary |
|---|---|
| public PoolingClientConnectionManager(final SchemeRegistry schemeRegistry, final long timeToLive, final TimeUnit timeUnit)
Deprecated as a consequence of | |
| PoolingClientConnectionManager | back to summary |
|---|---|
| public PoolingClientConnectionManager(final SchemeRegistry schemeRegistry, final long timeToLive, final TimeUnit timeUnit, final DnsResolver dnsResolver)
Deprecated as a consequence of | |
| closeExpiredConnections | back to summary |
|---|---|
| public void closeExpiredConnections() Implements org. Doc from org. Closes all expired connections in the pool. Open connections in the pool that have not been used for the timespan defined when the connection was released will be closed. Currently allocated connections are not subject to this method. Times will be checked with milliseconds precision.
| |
| closeIdleConnections | back to summary |
|---|---|
| public void closeIdleConnections(final long idleTimeout, final TimeUnit timeUnit) Implements org. Doc from org. Closes idle connections in the pool. Open connections in the pool that have not been used for the timespan given by the argument will be closed. Currently allocated connections are not subject to this method. Times will be checked with milliseconds precision All expired connections will also be closed. | |
| createConnectionOperator | back to summary |
|---|---|
| protected ClientConnectionOperator createConnectionOperator(final SchemeRegistry schreg)
Deprecated as a consequence of Hook for creating the connection operator.
It is called by the constructor.
Derived classes can override this method to change the
instantiation of the operator.
The default implementation here instantiates
| |
| finalize | back to summary |
|---|---|
| protected void finalize() throws Throwable Overrides java. Doc from java. Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
A subclass overrides the
When running in a Java virtual machine in which finalization has been
disabled or removed, the garbage collector will never call
The general contract of
The
The Java programming language does not guarantee which thread will
invoke the
After the
The
Any exception thrown by the | |
| format | back to summary |
|---|---|
| private String format(final HttpRoute route, final Object state) | |
| format | back to summary |
|---|---|
| private String format(final HttpPoolEntry entry)
Deprecated as a consequence of | |
| formatStats | back to summary |
|---|---|
| private String formatStats(final HttpRoute route) | |
| getDefaultMaxPerRoute | back to summary |
|---|---|
| public int getDefaultMaxPerRoute() Implements org.
| |
| getMaxPerRoute | back to summary |
|---|---|
| public int getMaxPerRoute(final HttpRoute route) Implements org.
| |
| getMaxTotal | back to summary |
|---|---|
| public int getMaxTotal() Implements org.
| |
| getSchemeRegistry | back to summary |
|---|---|
| public SchemeRegistry getSchemeRegistry() Implements org. Doc from org. Deprecated as a consequence of Obtains the scheme registry used by this manager.
| |
| getStats | back to summary |
|---|---|
| public PoolStats getStats(final HttpRoute route) Implements org.
| |
| getTotalStats | back to summary |
|---|---|
| public PoolStats getTotalStats() Implements org.
| |
| leaseConnection | back to summary |
|---|---|
| pack-priv ManagedClientConnection leaseConnection(final Future<HttpPoolEntry> future, final long timeout, final TimeUnit timeUnit) throws InterruptedException, ConnectionPoolTimeoutException
Deprecated as a consequence of | |
| releaseConnection | back to summary |
|---|---|
| public void releaseConnection(final ManagedClientConnection conn, final long keepalive, final TimeUnit timeUnit) Implements org. Doc from org. Deprecated as a consequence of Releases a connection for use by others. You may optionally specify how long the connection is valid to be reused. Values <= 0 are considered to be valid forever. If the connection is not marked as reusable, the connection will not be reused regardless of the valid duration. If the connection has been released before, the call will be ignored.
| |
| requestConnection | back to summary |
|---|---|
| public ClientConnectionRequest requestConnection(final HttpRoute route, final Object state) Implements org. Doc from org. Deprecated as a consequence of Returns a new
| |
| setDefaultMaxPerRoute | back to summary |
|---|---|
| public void setDefaultMaxPerRoute(final int max) Implements org.
| |
| setMaxPerRoute | back to summary |
|---|---|
| public void setMaxPerRoute(final HttpRoute route, final int max) Implements org.
| |
| setMaxTotal | back to summary |
|---|---|
| public void setMaxTotal(final int max) Implements org.
| |
| shutdown | back to summary |
|---|---|
| public void shutdown() Implements org. Doc from org. Shuts down this connection manager and releases allocated resources. This includes closing all connections, whether they are currently used or not.
| |