Deprecated
(4.3) use BasicHttpClientConnectionManager.
This connection manager will make an effort to reuse the connection for subsequent requests
with the same route. It will, however, close the existing connection and
open it for the given route, if the route of the persistent connection does not match that
of the connection request. If the connection has been already been allocated
IllegalStateException is thrown.
This connection manager implementation should be used inside an EJB container instead of
PoolingClientConnectionManager.
| Modifier and Type | Field and Description |
|---|---|
| private ManagedClientConnectionImpl | conn
The currently issued managed connection, if any. |
| private final ClientConnectionOperator | connOperator
The operator for opening and updating connections. |
| private static final AtomicLong | |
| private final Log | |
| public static final String | MISUSE_MESSAGE
The message to be logged on multiple allocation. |
| private HttpPoolEntry | poolEntry
The one and only entry in this pool. |
| private final SchemeRegistry | schemeRegistry
The schemes supported by this connection manager. |
| private volatile boolean | shutdown
Indicates whether this connection manager is shut down. |
| Access | Constructor and Description |
|---|---|
| public | BasicClientConnectionManager(final SchemeRegistry
the scheme registry schreg)
Deprecated
as a consequence of
Creates a new simple connection manager.
SchemeRegistry being deprecated.
|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public void | closeExpiredConnections()
Implements org. |
| public void | closeIdleConnections(final long
the idle time of connections to be closed idletime, final TimeUnit the unit for the timeUnit)idletimeImplements org. |
| protected ClientConnectionOperator | createConnectionOperator(final SchemeRegistry schreg)
Deprecated
as a consequence of
SchemeRegistry and ClientConnectionOperator being deprecated.
|
| protected void | finalize()
Overrides java. |
| pack-priv ManagedClientConnection | getConnection(final HttpRoute route, final Object state)
Deprecated
as a consequence of
ManagedClientConnection being deprecated.
|
| public SchemeRegistry | getSchemeRegistry()
Implements org.
Deprecated
as a consequence of
Obtains the scheme registry used by this manager.
SchemeRegistry 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 final 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 | shutdown()
Implements org. |
| private void |
| conn | back to summary |
|---|---|
| private ManagedClientConnectionImpl conn
Deprecated as a consequence of The currently issued managed connection, if any. | |
| connOperator | back to summary |
|---|---|
| private final ClientConnectionOperator connOperator
Deprecated as a consequence of The operator for opening and updating connections. | |
| COUNTER | back to summary |
|---|---|
| private static final AtomicLong COUNTER | |
| log | back to summary |
|---|---|
| private final Log log | |
| MISUSE_MESSAGE | back to summary |
|---|---|
| public static final String MISUSE_MESSAGE The message to be logged on multiple allocation. | |
| poolEntry | back to summary |
|---|---|
| private HttpPoolEntry poolEntry
Deprecated as a consequence of The one and only entry in this pool. | |
| schemeRegistry | back to summary |
|---|---|
| private final SchemeRegistry schemeRegistry
Deprecated as a consequence of The schemes supported by this connection manager. | |
| shutdown | back to summary |
|---|---|
| private volatile boolean shutdown Indicates whether this connection manager is shut down. | |
| BasicClientConnectionManager | back to summary |
|---|---|
| public BasicClientConnectionManager(final SchemeRegistry schreg)
Deprecated as a consequence of Creates a new simple connection manager.
| |
| BasicClientConnectionManager | back to summary |
|---|---|
| public BasicClientConnectionManager() | |
| assertNotShutdown | back to summary |
|---|---|
| private void assertNotShutdown() | |
| 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 idletime, 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 | |
| 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 | |
| getConnection | back to summary |
|---|---|
| pack-priv ManagedClientConnection getConnection(final HttpRoute route, final Object state)
Deprecated as a consequence of | |
| 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.
| |
| 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 final ClientConnectionRequest requestConnection(final HttpRoute route, final Object state) Implements org. Doc from org. Deprecated as a consequence of Returns a new
| |
| 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.
| |
| shutdownConnection | back to summary |
|---|---|
| private void shutdownConnection(final HttpClientConnection conn) | |