BasicClientConnectionManager
@ThreadSafe @Deprecated public class SingleClientConnManager extends 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 and 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 and 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 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 and Description |
---|
SingleClientConnManager()
Deprecated.
|
SingleClientConnManager(HttpParams params,
SchemeRegistry schreg)
Deprecated.
(4.1) use
SingleClientConnManager(SchemeRegistry) |
SingleClientConnManager(SchemeRegistry schreg)
Deprecated.
Creates a new simple connection manager.
|
Modifier and Type | Method and 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,
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,
Object state)
Deprecated.
Obtains a connection.
|
SchemeRegistry |
getSchemeRegistry()
Deprecated.
Obtains the scheme registry used by this manager.
|
void |
releaseConnection(ManagedClientConnection conn,
long validDuration,
TimeUnit timeUnit)
Deprecated.
Releases a connection for use by others.
|
ClientConnectionRequest |
requestConnection(HttpRoute route,
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 String MISUSE_MESSAGE
protected final SchemeRegistry schemeRegistry
protected final ClientConnectionOperator connOperator
protected final boolean alwaysShutDown
@GuardedBy(value="this") protected volatile SingleClientConnManager.PoolEntry uniquePoolEntry
@GuardedBy(value="this") protected volatile SingleClientConnManager.ConnAdapter managedConn
@GuardedBy(value="this") protected volatile long lastReleaseTime
@GuardedBy(value="this") protected volatile long connectionExpiresTime
protected volatile boolean isShutDown
@Deprecated public SingleClientConnManager(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 Throwable
public SchemeRegistry getSchemeRegistry()
ClientConnectionManager
getSchemeRegistry
in interface ClientConnectionManager
null
protected ClientConnectionOperator createConnectionOperator(SchemeRegistry schreg)
DefaultClientConnectionOperator
.schreg
- the scheme registry to use, or null
protected final void assertStillUp() throws IllegalStateException
IllegalStateException
- if this manager is shut downpublic final ClientConnectionRequest requestConnection(HttpRoute route, Object state)
ClientConnectionManager
ClientConnectionRequest
, from which a
ManagedClientConnection
can be obtained or the request can be
aborted.requestConnection
in interface ClientConnectionManager
public ManagedClientConnection getConnection(HttpRoute route, Object state)
route
- where the connection should point topublic void releaseConnection(ManagedClientConnection conn, long validDuration, TimeUnit timeUnit)
ClientConnectionManager
releaseConnection
in interface ClientConnectionManager
conn
- 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()
ClientConnectionManager
closeExpiredConnections
in interface ClientConnectionManager
public void closeIdleConnections(long idletime, TimeUnit tunit)
ClientConnectionManager
closeIdleConnections
in interface ClientConnectionManager
idletime
- the idle time of connections to be closedtunit
- the unit for the idletime
ClientConnectionManager.closeExpiredConnections()
public void shutdown()
ClientConnectionManager
shutdown
in interface ClientConnectionManager
protected void revokeConnection()
Copyright © 1999–2013 The Apache Software Foundation. All rights reserved.