Deprecated
(4.2) use BasicClientConnectionManager
SingleClientConnManager 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.
| Modifier and Type | Class and Description |
|---|---|
| protected class | SingleClientConnManager.ConnAdapter
Deprecated
as a consequence of The connection adapter used by this manager.
AbstractPooledConnAdapter being deprecated.
|
| protected class | SingleClientConnManager.PoolEntry
Deprecated
as a consequence of The pool entry for this connection manager.
AbstractPoolEntry being deprecated.
|
| Modifier and Type | Field and Description |
|---|---|
| protected final boolean | alwaysShutDown
Whether the connection should be shut down on release. |
| protected volatile long | connectionExpiresTime
The time the last released connection expires and shouldn't be reused. |
| protected final ClientConnectionOperator | connOperator
The operator for opening and updating connections. |
| protected volatile boolean | isShutDown
Indicates whether this connection manager is shut down. |
| protected volatile long | lastReleaseTime
The time of the last connection release, or -1. |
| private final Log | |
| protected volatile SingleClientConnManager. | managedConn
The currently issued managed connection, if any. |
| public static final String | MISUSE_MESSAGE
The message to be logged on multiple allocation. |
| protected final SchemeRegistry | schemeRegistry
The schemes supported by this connection manager. |
| protected volatile SingleClientConnManager. | uniquePoolEntry
The one and only entry in this pool. |
| Access | Constructor and Description |
|---|---|
| public | SingleClientConnManager(final HttpParams
the parameters for this manager params, final SchemeRegistry the scheme registry schreg)
Deprecated
(4.1) use
Creates a new simple connection manager.
SingleClientConnManager#SingleClientConnManager(SchemeRegistry)
|
| public | SingleClientConnManager(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 |
|---|---|
| protected final 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 | Returns: the connection operator to usethe scheme registry to use, or schreg)null
Deprecated
as a consequence of
Hook for creating the connection operator.
SchemeRegistry and ClientConnectionOperator being deprecated.
|
| protected void | finalize()
Overrides java. |
| public ManagedClientConnection | Returns: a connection that can be used to communicate along the given routewhere the connection should point to route, final Object state)
Deprecated
as a consequence of
Obtains a connection.
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 validDuration, 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.
|
| protected void | |
| public void | shutdown()
Implements org. |
| alwaysShutDown | back to summary |
|---|---|
| protected final boolean alwaysShutDown Whether the connection should be shut down on release. | |
| connectionExpiresTime | back to summary |
|---|---|
| protected volatile long connectionExpiresTime The time the last released connection expires and shouldn't be reused. | |
| connOperator | back to summary |
|---|---|
| protected final ClientConnectionOperator connOperator
Deprecated as a consequence of The operator for opening and updating connections. | |
| isShutDown | back to summary |
|---|---|
| protected volatile boolean isShutDown Indicates whether this connection manager is shut down. | |
| lastReleaseTime | back to summary |
|---|---|
| protected volatile long lastReleaseTime The time of the last connection release, or -1. | |
| log | back to summary |
|---|---|
| private final Log log | |
| managedConn | back to summary |
|---|---|
| protected volatile SingleClientConnManager. Deprecated as a consequence of The currently issued managed connection, if any. | |
| MISUSE_MESSAGE | back to summary |
|---|---|
| public static final String MISUSE_MESSAGE The message to be logged on multiple allocation. | |
| schemeRegistry | back to summary |
|---|---|
| protected final SchemeRegistry schemeRegistry
Deprecated as a consequence of The schemes supported by this connection manager. | |
| uniquePoolEntry | back to summary |
|---|---|
| protected volatile SingleClientConnManager. Deprecated as a consequence of The one and only entry in this pool. | |
| SingleClientConnManager | back to summary |
|---|---|
| public SingleClientConnManager(final HttpParams params, final SchemeRegistry schreg)
Deprecated (4.1) use Creates a new simple connection manager.
| |
| SingleClientConnManager | back to summary |
|---|---|
| public SingleClientConnManager(final SchemeRegistry schreg)
Deprecated as a consequence of Creates a new simple connection manager.
| |
| SingleClientConnManager | back to summary |
|---|---|
public SingleClientConnManager()
| |
| assertStillUp | back to summary |
|---|---|
| protected final void assertStillUp() throws IllegalStateException Asserts that this manager is not shut down.
| |
| 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 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 | |
| getConnection | back to summary |
|---|---|
| public ManagedClientConnection getConnection(final HttpRoute route, final Object state)
Deprecated as a consequence of Obtains a connection.
| |
| 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 validDuration, 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
| |
| revokeConnection | back to summary |
|---|---|
| protected void revokeConnection() | |
| 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.
| |
Deprecated
as a consequence of AbstractPooledConnAdapter being deprecated. See corresponding docs for further information.
| Access | Constructor and Description |
|---|---|
| protected | ConnAdapter(final SingleClientConnManager.
the pool entry for the connection being wrapped entry,the planned route for this connection route)
Deprecated
as a consequence of
Creates a new connection adapter.
SingleClientConnManager.PoolEntry being deprecated.
|
| ConnAdapter | back to summary |
|---|---|
| protected ConnAdapter(final SingleClientConnManager. Deprecated as a consequence of Creates a new connection adapter.
| |
Deprecated
as a consequence of AbstractPoolEntry being deprecated. See corresponding docs for further information.
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| protected void | |
| protected void |
| PoolEntry | back to summary |
|---|---|
| protected PoolEntry() Creates a new pool entry. | |
| close | back to summary |
|---|---|
| protected void close() throws IOException Closes the connection in this pool entry. | |
| shutdown | back to summary |
|---|---|
| protected void shutdown() throws IOException Shuts down the connection in this pool entry. | |