Top Description Methods
org.apache.http.conn

public Interface ClientConnectionManager

Known Direct Implementers
org.apache.http.impl.conn.BasicClientConnectionManager, org.apache.http.impl.conn.PoolingClientConnectionManager, org.apache.http.impl.conn.SingleClientConnManager, org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager
Annotations
@Deprecated
Imports
java.util.concurrent.TimeUnit, org.apache.http.conn.routing.HttpRoute, org.apache.http.conn.scheme.SchemeRegistry

Deprecated

(4.3) replaced by HttpClientConnectionManager.

Management interface for client connections. The purpose of an HTTP connection manager is to serve as a factory for new HTTP connections, manage persistent connections and synchronize access to persistent connections making sure that only one thread of execution can have access to a connection at a time.

Implementations of this interface must be thread-safe. Access to shared data must be synchronized as methods of this interface may be executed from multiple threads.

Since
4.0

Method Summary

Modifier and TypeMethod and Description
public void
closeExpiredConnections()

Closes all expired connections in the pool.

public void
closeIdleConnections(long
the idle time of connections to be closed
idletime
,
TimeUnit
the unit for the idletime
timeUnit
)

Closes idle connections in the pool.

public SchemeRegistry

Returns:

the scheme registry, never null
getSchemeRegistry
()

Deprecated as a consequence of SchemeRegistry being deprecated.
Obtains the scheme registry used by this manager.
public void
releaseConnection(ManagedClientConnection
the connection to release
conn
,
long
the duration of time this connection is valid for reuse
validDuration
,
TimeUnit
the unit of time validDuration is measured in
timeUnit
)

Deprecated as a consequence of ManagedClientConnection being deprecated.
Releases a connection for use by others.
public ClientConnectionRequest
requestConnection(HttpRoute route, Object state)

Deprecated as a consequence of ClientConnectionRequest being deprecated.
Returns a new ClientConnectionRequest, from which a ManagedClientConnection can be obtained or the request can be aborted.
public void
shutdown()

Shuts down this connection manager and releases allocated resources.

Method Detail

closeExpiredConnectionsback to summary
public void closeExpiredConnections()

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.

closeIdleConnectionsback to summary
public void closeIdleConnections(long idletime, TimeUnit timeUnit)

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.

Parameters
idletime:long

the idle time of connections to be closed

timeUnit:TimeUnit

the unit for the idletime

See Also
closeExpiredConnections()
getSchemeRegistryback to summary
public SchemeRegistry getSchemeRegistry()

Deprecated

as a consequence of SchemeRegistry being deprecated. See corresponding docs for further information.

Obtains the scheme registry used by this manager.

Returns:SchemeRegistry

the scheme registry, never null

releaseConnectionback to summary
public void releaseConnection(ManagedClientConnection conn, long validDuration, TimeUnit timeUnit)

Deprecated

as a consequence of ManagedClientConnection being deprecated. See corresponding docs for further information.

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.

Parameters
conn:ManagedClientConnection

the connection to release

validDuration:long

the duration of time this connection is valid for reuse

timeUnit:TimeUnit

the unit of time validDuration is measured in

See Also
closeExpiredConnections()
requestConnectionback to summary
public ClientConnectionRequest requestConnection(HttpRoute route, Object state)

Deprecated

as a consequence of ClientConnectionRequest being deprecated. See corresponding docs for further information.

Returns a new ClientConnectionRequest, from which a ManagedClientConnection can be obtained or the request can be aborted.

shutdownback to summary
public void shutdown()

Shuts down this connection manager and releases allocated resources. This includes closing all connections, whether they are currently used or not.