|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface HttpClientConnectionManager
Represents a manager of persistent 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.
Method Summary | |
---|---|
void |
closeExpiredConnections()
Closes all expired connections in the pool. |
void |
closeIdleConnections(long idletime,
TimeUnit tunit)
Closes idle connections in the pool. |
void |
connect(HttpClientConnection conn,
HttpRoute route,
int connectTimeout,
HttpContext context)
|
void |
releaseConnection(HttpClientConnection conn,
Object newState,
long validDuration,
TimeUnit timeUnit)
Releases a connection for use by others. |
ConnectionRequest |
requestConnection(HttpRoute route,
Object state)
Returns a new ClientConnectionRequest , from which a
HttpClientConnection can be obtained or the request can be
aborted. |
void |
routeComplete(HttpClientConnection conn,
HttpRoute route,
HttpContext context)
|
void |
shutdown()
Shuts down this connection manager and releases allocated resources. |
void |
upgrade(HttpClientConnection conn,
HttpRoute route,
HttpContext context)
|
Method Detail |
---|
ConnectionRequest requestConnection(HttpRoute route, Object state)
ClientConnectionRequest
, from which a
HttpClientConnection
can be obtained or the request can be
aborted.
void releaseConnection(HttpClientConnection conn, Object newState, long validDuration, TimeUnit timeUnit)
conn
- the connection to releasevalidDuration
- the duration of time this connection is valid for reusetimeUnit
- the unit of time validDuration is measured incloseExpiredConnections()
void connect(HttpClientConnection conn, HttpRoute route, int connectTimeout, HttpContext context) throws IOException
IOException
void upgrade(HttpClientConnection conn, HttpRoute route, HttpContext context) throws IOException
IOException
void routeComplete(HttpClientConnection conn, HttpRoute route, HttpContext context) throws IOException
IOException
void closeIdleConnections(long idletime, TimeUnit tunit)
idletime
- the idle time of connections to be closedtunit
- the unit for the idletime
closeExpiredConnections()
void closeExpiredConnections()
void shutdown()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |