Home » commons-httpclient-3.1-src » org.apache.commons » httpclient » [javadoc | source]
org.apache.commons.httpclient
public class: MultiThreadedHttpConnectionManager [javadoc | source]
java.lang.Object
   org.apache.commons.httpclient.MultiThreadedHttpConnectionManager

All Implemented Interfaces:
    HttpConnectionManager

Manages a set of HttpConnections for various HostConfigurations.
Field Summary
public static final  int DEFAULT_MAX_HOST_CONNECTIONS    The default maximum number of connections allowed per host 
public static final  int DEFAULT_MAX_TOTAL_CONNECTIONS    The default maximum number of connections allowed overall 
Constructor:
 public MultiThreadedHttpConnectionManager() 
Method from org.apache.commons.httpclient.MultiThreadedHttpConnectionManager Summary:
closeIdleConnections,   deleteClosedConnections,   getConnection,   getConnection,   getConnectionWithTimeout,   getConnectionsInPool,   getConnectionsInPool,   getConnectionsInUse,   getConnectionsInUse,   getMaxConnectionsPerHost,   getMaxTotalConnections,   getParams,   isConnectionStaleCheckingEnabled,   releaseConnection,   setConnectionStaleCheckingEnabled,   setMaxConnectionsPerHost,   setMaxTotalConnections,   setParams,   shutdown,   shutdownAll
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.commons.httpclient.MultiThreadedHttpConnectionManager Detail:
 public  void closeIdleConnections(long idleTimeout) 
 public  void deleteClosedConnections() 
    Deletes all closed connections. Only connections currently owned by the connection manager are processed.
 public HttpConnection getConnection(HostConfiguration hostConfiguration) 
 public HttpConnection getConnection(HostConfiguration hostConfiguration,
    long timeout) throws HttpException 
Deprecated! Use - #getConnectionWithTimeout(HostConfiguration, long)

 public HttpConnection getConnectionWithTimeout(HostConfiguration hostConfiguration,
    long timeout) throws ConnectionPoolTimeoutException 
    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.
 public int getConnectionsInPool() 
    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 maximum number of connections .
 public int getConnectionsInPool(HostConfiguration hostConfiguration) 
    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 maximum number of connections per host .
 public int getConnectionsInUse() 
Deprecated! Use - #getConnectionsInPool()

    Gets the total number of connections in use.
 public int getConnectionsInUse(HostConfiguration hostConfiguration) 
Deprecated! Use - #getConnectionsInPool(HostConfiguration)

    Gets the number of connections in use for this configuration.
 public int getMaxConnectionsPerHost() 
Deprecated! Use - HttpConnectionManagerParams#getDefaultMaxConnectionsPerHost() , HttpConnectionManager#getParams() .

    Gets the maximum number of connections allowed for a given hostConfiguration.
 public int getMaxTotalConnections() 
Deprecated! Use - HttpConnectionManagerParams#getMaxTotalConnections() , HttpConnectionManager#getParams() .

    Gets the maximum number of connections allowed for this connection manager.
 public HttpConnectionManagerParams getParams() 
    Returns parameters associated with this connection manager.
 public boolean isConnectionStaleCheckingEnabled() 
Deprecated! Use - HttpConnectionManagerParams#isStaleCheckingEnabled() , HttpConnectionManager#getParams() .

    Gets the staleCheckingEnabled value to be set on HttpConnections that are created.
 public  void releaseConnection(HttpConnection conn) 
    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.
 public  void setConnectionStaleCheckingEnabled(boolean connectionStaleCheckingEnabled) 
Deprecated! Use - HttpConnectionManagerParams#setStaleCheckingEnabled(boolean) , HttpConnectionManager#getParams() .

    Sets the staleCheckingEnabled value to be set on HttpConnections that are created.
 public  void setMaxConnectionsPerHost(int maxHostConnections) 
Deprecated! Use - HttpConnectionManagerParams#setDefaultMaxConnectionsPerHost(int) , HttpConnectionManager#getParams() .

    Sets the maximum number of connections allowed for a given HostConfiguration. Per RFC 2616 section 8.1.4, this value defaults to 2.
 public  void setMaxTotalConnections(int maxTotalConnections) 
Deprecated! Use - HttpConnectionManagerParams#setMaxTotalConnections(int) , HttpConnectionManager#getParams() .

    Sets the maximum number of connections allowed for this connection manager.
 public  void setParams(HttpConnectionManagerParams params) 
 public synchronized  void shutdown() 
    Shuts down the connection manager and releases all resources. All connections associated with this class will be closed and released.

    The connection manager can no longer be used once shut down.

    Calling this method more than once will have no effect.

 public static  void shutdownAll() 
    Shuts down and cleans up resources used by all instances of MultiThreadedHttpConnectionManager. All static resources are released, all threads are stopped, and #shutdown() is called on all live instances of MultiThreadedHttpConnectionManager.