BasicHttpClientConnectionManager.@ThreadSafe @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 |
|---|---|
static java.lang.String |
MISUSE_MESSAGE
Deprecated.
The message to be logged on multiple allocation.
|
| Constructor and Description |
|---|
BasicClientConnectionManager()
Deprecated.
|
BasicClientConnectionManager(SchemeRegistry schreg)
Deprecated.
Creates a new simple connection manager.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
public static final java.lang.String MISUSE_MESSAGE
public BasicClientConnectionManager(SchemeRegistry schreg)
schreg - the scheme registrypublic BasicClientConnectionManager()
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)
public 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 ClientConnectionManagerManagedClientConnection getConnection(HttpRoute route, java.lang.Object state)
public void releaseConnection(ManagedClientConnection conn, long keepalive, java.util.concurrent.TimeUnit tunit)
ClientConnectionManagerreleaseConnection in interface ClientConnectionManagerconn - 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()
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 ClientConnectionManager