BasicHttpClientConnectionManager
.@Contract(threading=SAFE) @Deprecated public class BasicClientConnectionManager extends java.lang.Object implements ClientConnectionManager
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
Deprecated.
The currently issued managed connection, if any.
|
private ClientConnectionOperator |
connOperator
Deprecated.
The operator for opening and updating connections.
|
private static java.util.concurrent.atomic.AtomicLong |
COUNTER
Deprecated.
|
private org.apache.commons.logging.Log |
log
Deprecated.
|
static java.lang.String |
MISUSE_MESSAGE
Deprecated.
The message to be logged on multiple allocation.
|
private HttpPoolEntry |
poolEntry
Deprecated.
The one and only entry in this pool.
|
private SchemeRegistry |
schemeRegistry
Deprecated.
The schemes supported by this connection manager.
|
private boolean |
shutdown
Deprecated.
Indicates whether this connection manager is shut down.
|
Constructor and Description |
---|
BasicClientConnectionManager()
Deprecated.
|
BasicClientConnectionManager(SchemeRegistry schreg)
Deprecated.
Creates a new simple connection manager.
|
Modifier and Type | Method and Description |
---|---|
private void |
assertNotShutdown()
Deprecated.
|
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.
|
protected void |
finalize()
Deprecated.
|
(package private) ManagedClientConnection |
getConnection(HttpRoute route,
java.lang.Object state)
Deprecated.
|
SchemeRegistry |
getSchemeRegistry()
Deprecated.
Obtains the scheme registry used by this manager.
|
void |
releaseConnection(ManagedClientConnection conn,
long keepalive,
java.util.concurrent.TimeUnit tunit)
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. |
void |
shutdown()
Deprecated.
Shuts down this connection manager and releases allocated resources.
|
private void |
shutdownConnection(org.apache.http.HttpClientConnection conn)
Deprecated.
|
private final org.apache.commons.logging.Log log
private static final java.util.concurrent.atomic.AtomicLong COUNTER
public static final java.lang.String MISUSE_MESSAGE
private final SchemeRegistry schemeRegistry
private final ClientConnectionOperator connOperator
private HttpPoolEntry poolEntry
private ManagedClientConnectionImpl conn
private volatile boolean shutdown
public BasicClientConnectionManager(SchemeRegistry schreg)
schreg
- the scheme registrypublic BasicClientConnectionManager()
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public SchemeRegistry getSchemeRegistry()
ClientConnectionManager
getSchemeRegistry
in interface ClientConnectionManager
null
protected ClientConnectionOperator createConnectionOperator(SchemeRegistry schreg)
public final ClientConnectionRequest requestConnection(HttpRoute route, java.lang.Object state)
ClientConnectionManager
ClientConnectionRequest
, from which a
ManagedClientConnection
can be obtained or the request can be
aborted.requestConnection
in interface ClientConnectionManager
private void assertNotShutdown()
ManagedClientConnection getConnection(HttpRoute route, java.lang.Object state)
private void shutdownConnection(org.apache.http.HttpClientConnection conn)
public void releaseConnection(ManagedClientConnection conn, long keepalive, java.util.concurrent.TimeUnit tunit)
ClientConnectionManager
releaseConnection
in interface ClientConnectionManager
conn
- the connection to releasekeepalive
- the duration of time this connection is valid for reusetunit
- the unit of time validDuration is measured inClientConnectionManager.closeExpiredConnections()
public void closeExpiredConnections()
ClientConnectionManager
closeExpiredConnections
in interface ClientConnectionManager
public void closeIdleConnections(long idletime, java.util.concurrent.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