|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.commons.httpclient.MultiThreadedHttpConnectionManager
Manages a set of HttpConnections for various HostConfigurations.
| Field Summary | |
static int |
DEFAULT_MAX_HOST_CONNECTIONS
The default maximum number of connections allowed per host |
static int |
DEFAULT_MAX_TOTAL_CONNECTIONS
The default maximum number of connections allowed overall |
static java.util.Map |
REFERENCE_TO_CONNECTION_SOURCE
A mapping from Reference to ConnectionSource. |
| Constructor Summary | |
MultiThreadedHttpConnectionManager()
No-args constructor |
|
| Method Summary | |
HttpConnection |
getConnection(org.apache.commons.httpclient.HostConfiguration hostConfiguration)
|
HttpConnection |
getConnection(org.apache.commons.httpclient.HostConfiguration hostConfiguration,
long timeout)
|
int |
getConnectionsInUse()
Gets the total number of connections in use. |
int |
getConnectionsInUse(org.apache.commons.httpclient.HostConfiguration hostConfiguration)
Gets the number of connections in use for this configuration. |
int |
getMaxConnectionsPerHost()
Gets the maximum number of connections allowed for a given hostConfiguration. |
int |
getMaxTotalConnections()
Gets the maximum number of connections allowed in the system. |
boolean |
isConnectionStaleCheckingEnabled()
Gets the staleCheckingEnabled value to be set on HttpConnections that are created. |
void |
releaseConnection(HttpConnection conn)
Make the given HttpConnection available for use by other requests. |
void |
setConnectionStaleCheckingEnabled(boolean connectionStaleCheckingEnabled)
Sets the staleCheckingEnabled value to be set on HttpConnections that are created. |
void |
setMaxConnectionsPerHost(int maxHostConnections)
Sets the maximum number of connections allowed for a given HostConfiguration. |
void |
setMaxTotalConnections(int maxTotalConnections)
Sets the maximum number of connections allowed in the system. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int DEFAULT_MAX_HOST_CONNECTIONS
public static final int DEFAULT_MAX_TOTAL_CONNECTIONS
public static final java.util.Map REFERENCE_TO_CONNECTION_SOURCE
| Constructor Detail |
public MultiThreadedHttpConnectionManager()
| Method Detail |
public boolean isConnectionStaleCheckingEnabled()
true if stale checking will be enabled on HttpConectionsHttpConnection.isStaleCheckingEnabled()public void setConnectionStaleCheckingEnabled(boolean connectionStaleCheckingEnabled)
connectionStaleCheckingEnabled - true if stale checking will be enabled
on HttpConectionsHttpConnection.setStaleCheckingEnabled(boolean)public void setMaxConnectionsPerHost(int maxHostConnections)
maxHostConnections - the number of connections allowed for each
hostConfigurationpublic int getMaxConnectionsPerHost()
public void setMaxTotalConnections(int maxTotalConnections)
maxTotalConnections - the maximum number of connections allowedpublic int getMaxTotalConnections()
public HttpConnection getConnection(org.apache.commons.httpclient.HostConfiguration hostConfiguration)
getConnection in interface org.apache.commons.httpclient.HttpConnectionManagerHttpConnectionManager#getConnection(HostConfiguration)
public HttpConnection getConnection(org.apache.commons.httpclient.HostConfiguration hostConfiguration,
long timeout)
throws org.apache.commons.httpclient.HttpException
getConnection in interface org.apache.commons.httpclient.HttpConnectionManagerorg.apache.commons.httpclient.HttpExceptionHttpConnectionManager#getConnection(HostConfiguration, long)public int getConnectionsInUse(org.apache.commons.httpclient.HostConfiguration hostConfiguration)
hostConfiguration - the key that connections are tracked on
public int getConnectionsInUse()
public void releaseConnection(HttpConnection conn)
releaseConnection in interface org.apache.commons.httpclient.HttpConnectionManagerconn - the HttpConnection to make available.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||