ClientConnectionManagerBasicClientConnectionManager@Contract(threading=SAFE) @Deprecated public class SingleClientConnManager extends java.lang.Object implements ClientConnectionManager
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 | Description |
|---|---|---|
protected class |
SingleClientConnManager.ConnAdapter |
Deprecated.
The connection adapter used by this manager.
|
protected class |
SingleClientConnManager.PoolEntry |
Deprecated.
The pool entry for this connection manager.
|
| Modifier and Type | Field | Description |
|---|---|---|
protected boolean |
alwaysShutDown |
Deprecated.
Whether the connection should be shut down on release.
|
protected long |
connectionExpiresTime |
Deprecated.
The time the last released connection expires and shouldn't be reused.
|
protected ClientConnectionOperator |
connOperator |
Deprecated.
The operator for opening and updating connections.
|
protected boolean |
isShutDown |
Deprecated.
Indicates whether this connection manager is shut down.
|
protected long |
lastReleaseTime |
Deprecated.
The time of the last connection release, or -1.
|
protected SingleClientConnManager.ConnAdapter |
managedConn |
Deprecated.
The currently issued managed connection, if any.
|
static java.lang.String |
MISUSE_MESSAGE |
Deprecated.
The message to be logged on multiple allocation.
|
protected SchemeRegistry |
schemeRegistry |
Deprecated.
The schemes supported by this connection manager.
|
protected SingleClientConnManager.PoolEntry |
uniquePoolEntry |
Deprecated.
The one and only entry in this pool.
|
| Constructor | Description |
|---|---|
SingleClientConnManager() |
Deprecated.
|
SingleClientConnManager(SchemeRegistry schreg) |
Deprecated.
Creates a new simple connection manager.
|
SingleClientConnManager(org.apache.http.params.HttpParams params,
SchemeRegistry schreg) |
Deprecated.
(4.1) use
SingleClientConnManager(SchemeRegistry) |
| Modifier and Type | Method | Description |
|---|---|---|
protected void |
assertStillUp() |
Deprecated.
Asserts that this manager is not shut down.
|
void |
closeExpiredConnections() |
Deprecated.
Closes all expired connections in the pool.
|
void |
closeIdleConnections(long idletime,
java.util.concurrent.TimeUnit tunit) |
Deprecated.
Closes idle connections in the pool.
|
protected ClientConnectionOperator |
createConnectionOperator(SchemeRegistry schreg) |
Deprecated.
Hook for creating the connection operator.
|
protected void |
finalize() |
Deprecated.
|
ManagedClientConnection |
getConnection(HttpRoute route,
java.lang.Object state) |
Deprecated.
Obtains a connection.
|
SchemeRegistry |
getSchemeRegistry() |
Deprecated.
Obtains the scheme registry used by this manager.
|
void |
releaseConnection(ManagedClientConnection conn,
long validDuration,
java.util.concurrent.TimeUnit timeUnit) |
Deprecated.
Releases a connection for use by others.
|
ClientConnectionRequest |
requestConnection(HttpRoute route,
java.lang.Object state) |
Deprecated.
Returns a new
ClientConnectionRequest, from which a
ManagedClientConnection can be obtained or the request can be
aborted. |
protected void |
revokeConnection() |
Deprecated.
|
void |
shutdown() |
Deprecated.
Shuts down this connection manager and releases allocated resources.
|
public static final java.lang.String MISUSE_MESSAGE
protected final SchemeRegistry schemeRegistry
protected final ClientConnectionOperator connOperator
protected final boolean alwaysShutDown
protected volatile SingleClientConnManager.PoolEntry uniquePoolEntry
protected volatile SingleClientConnManager.ConnAdapter managedConn
protected volatile long lastReleaseTime
protected volatile long connectionExpiresTime
protected volatile boolean isShutDown
@Deprecated
public SingleClientConnManager(org.apache.http.params.HttpParams params,
SchemeRegistry schreg)
SingleClientConnManager(SchemeRegistry)params - the parameters for this managerschreg - the scheme registrypublic SingleClientConnManager(SchemeRegistry schreg)
schreg - the scheme registrypublic SingleClientConnManager()
protected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwablepublic SchemeRegistry getSchemeRegistry()
ClientConnectionManagergetSchemeRegistry in interface ClientConnectionManagernullprotected ClientConnectionOperator createConnectionOperator(SchemeRegistry schreg)
DefaultClientConnectionOperator.schreg - the scheme registry to use, or nullprotected final void assertStillUp()
throws java.lang.IllegalStateException
java.lang.IllegalStateException - if this manager is shut downpublic final ClientConnectionRequest requestConnection(HttpRoute route, java.lang.Object state)
ClientConnectionManagerClientConnectionRequest, from which a
ManagedClientConnection can be obtained or the request can be
aborted.requestConnection in interface ClientConnectionManagerpublic ManagedClientConnection getConnection(HttpRoute route, java.lang.Object state)
route - where the connection should point topublic void releaseConnection(ManagedClientConnection conn, long validDuration, java.util.concurrent.TimeUnit timeUnit)
ClientConnectionManagerreleaseConnection in interface ClientConnectionManagerconn - the connection to releasevalidDuration - the duration of time this connection is valid for reusetimeUnit - the unit of time validDuration is measured inClientConnectionManager.closeExpiredConnections()public void closeExpiredConnections()
ClientConnectionManagercloseExpiredConnections in interface ClientConnectionManagerpublic void closeIdleConnections(long idletime,
java.util.concurrent.TimeUnit tunit)
ClientConnectionManagercloseIdleConnections in interface ClientConnectionManageridletime - the idle time of connections to be closedtunit - the unit for the idletimeClientConnectionManager.closeExpiredConnections()public void shutdown()
ClientConnectionManagershutdown in interface ClientConnectionManagerprotected void revokeConnection()