|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.commons.httpclient.HttpConnectionManager
Manages a set of HttpConnections for various host:ports. This class is used by HttpMultiClient.
Constructor Summary | |
HttpConnectionManager()
No-args constructor |
Method Summary | |
HttpConnection |
getConnection(java.lang.String sURL)
Get an HttpConnection for a given URL. |
HttpConnection |
getConnection(java.lang.String sURL,
long timeout)
Get an HttpConnection for a given URL. |
java.lang.Integer |
getConnectionsInUse(java.lang.String hostAndPort)
Get the number of connections in use for the key |
int |
getMaxConnectionsPerHost()
Get the maximum number of connections allowed for a given host:port. |
java.lang.String |
getProxyHost()
Get the proxy host. |
int |
getProxyPort()
Get the proxy port number. |
void |
releaseConnection(HttpConnection conn)
Make the given HttpConnection available for use by other requests. |
void |
setMaxConnectionsPerHost(int maxConnections)
Set the maximum number of connections allowed for a given host:port. |
void |
setProxyHost(java.lang.String proxyHost)
Set the proxy host to use for all connections. |
void |
setProxyPort(int proxyPort)
Set the proxy port to use for all connections. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public HttpConnectionManager()
Method Detail |
public void setProxyHost(java.lang.String proxyHost)
proxyHost
- - the proxy host namepublic java.lang.String getProxyHost()
public void setProxyPort(int proxyPort)
proxyPort
- - the proxy port numberpublic int getProxyPort()
public void setMaxConnectionsPerHost(int maxConnections)
maxConnections
- - number of connections allowed for each host:portpublic int getMaxConnectionsPerHost()
public HttpConnection getConnection(java.lang.String sURL) throws HttpException, java.net.MalformedURLException
sURL
- - a fully specified URL.java.net.MalformedURLException
- HttpException
- -
If no connection becomes available before the timeout expirespublic HttpConnection getConnection(java.lang.String sURL, long timeout) throws HttpException, java.net.MalformedURLException
timeout
milliseconds or until a
connection becomes available. If no connection becomes available before
the timeout expires an HttpException exception will be thrown.sURL
- - a fully specified URL.timeout
- - the time (in milliseconds) to wait for a connection
to become availablejava.net.MalformedURLException
- HttpException
- -
If no connection becomes available before the timeout expirespublic java.lang.Integer getConnectionsInUse(java.lang.String hostAndPort)
hostAndPort
- the key that connections are tracked onpublic void releaseConnection(HttpConnection conn)
conn
- - The HttpConnection to make available.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |