Manages a set of HttpConnections for various HostConfigurations.
author: Michael Becke author: Eric Johnson author: Mike Bowler author: Carl A. Dunham since: 2.0
setConnectionStaleCheckingEnabled(boolean connectionStaleCheckingEnabled) Sets the staleCheckingEnabled value to be set on HttpConnections that are created.
public void
setMaxConnectionsPerHost(int maxHostConnections) Sets the maximum number of connections allowed for a given
HostConfiguration.
public void
setMaxTotalConnections(int maxTotalConnections) Sets the maximum number of connections allowed for this connection manager.
Gets a connection or waits if one is not available. A connection is
available if one exists that is not being used or if fewer than
maxHostConnections have been created in the connectionPool, and fewer
than maxTotalConnections have been created in all connectionPools.
Parameters: hostConfiguration - The host configuration specifying the connectiondetails. Parameters: timeout - the number of milliseconds to wait for a connection, 0 towait indefinitely HttpConnection an available connection throws: HttpException - if a connection does not become available in'timeout' milliseconds since: 3.0
Gets the total number of pooled connections for the given host configuration. This
is the total number of connections that have been created and are still in use
by this connection manager for the host configuration. This value will
not exceed the
MultiThreadedHttpConnectionManager.getMaxConnectionsPerHost() maximum number of connections perhost .
Parameters: hostConfiguration - The host configuration The total number of pooled connections
Gets the total number of pooled connections. This is the total number of
connections that have been created and are still in use by this connection
manager. This value will not exceed the
MultiThreadedHttpConnectionManager.getMaxTotalConnections() maximum number of connections .
the total number of pooled connections
Make the given HttpConnection available for use by other requests.
If another thread is blocked in getConnection() that could use this
connection, it will be woken up.
Parameters: conn - the HttpConnection to make available.
setConnectionStaleCheckingEnabled
public void setConnectionStaleCheckingEnabled(boolean connectionStaleCheckingEnabled)(Code)