org.apache.commons.httpclient
Class ProxyClient.DummyConnectionManager

java.lang.Object
  extended byorg.apache.commons.httpclient.ProxyClient.DummyConnectionManager
All Implemented Interfaces:
HttpConnectionManager
Enclosing class:
ProxyClient

class ProxyClient.DummyConnectionManager
extends java.lang.Object
implements HttpConnectionManager

A connection manager that creates a single connection. Meant to be used only once.


Constructor Summary
(package private) ProxyClient.DummyConnectionManager()
           
 
Method Summary
 void closeIdleConnections(long idleTimeout)
          Closes connections that have been idle for at least the given amount of time.
 HttpConnection getConnection()
           
 HttpConnection getConnection(HostConfiguration hostConfiguration)
          Gets an HttpConnection for a given host configuration.
 HttpConnection getConnection(HostConfiguration hostConfiguration, long timeout)
          Gets an HttpConnection for a given host configuration.
 HttpConnection getConnectionWithTimeout(HostConfiguration hostConfiguration, long timeout)
          Gets an HttpConnection for a given host configuration.
 HttpConnectionManagerParams getParams()
          Returns parameters associated with this connection manager.
 void releaseConnection(HttpConnection conn)
          Releases the given HttpConnection for use by other requests.
 void setConnectionParams(HttpParams httpParams)
           
 void setParams(HttpConnectionManagerParams params)
          Assigns parameters for this connection manager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProxyClient.DummyConnectionManager

ProxyClient.DummyConnectionManager()
Method Detail

closeIdleConnections

public void closeIdleConnections(long idleTimeout)
Description copied from interface: HttpConnectionManager
Closes connections that have been idle for at least the given amount of time. Only connections that are currently owned, not checked out, are subject to idle timeouts.

Specified by:
closeIdleConnections in interface HttpConnectionManager
Parameters:
idleTimeout - the minimum idle time, in milliseconds, for connections to be closed

getConnection

public HttpConnection getConnection()

setConnectionParams

public void setConnectionParams(HttpParams httpParams)

getConnectionWithTimeout

public HttpConnection getConnectionWithTimeout(HostConfiguration hostConfiguration,
                                               long timeout)
Description copied from interface: HttpConnectionManager
Gets an HttpConnection for a given host configuration. If a connection is not available, this method will block for at most the specified number of milliseconds or until a connection becomes available. The connection manager should be registered with any HttpConnection that is created.

Specified by:
getConnectionWithTimeout in interface HttpConnectionManager
Parameters:
hostConfiguration - the host configuration to use to configure the connection
timeout - - the time (in milliseconds) to wait for a connection to become available, 0 to specify an infinite timeout
Returns:
an HttpConnection for the given configuraiton
See Also:
HttpConnection.setHttpConnectionManager(HttpConnectionManager)

getConnection

public HttpConnection getConnection(HostConfiguration hostConfiguration,
                                    long timeout)
                             throws HttpException
Deprecated.  

Description copied from interface: HttpConnectionManager
Gets an HttpConnection for a given host configuration. If a connection is not available, this method will block for at most the specified number of milliseconds or until a connection becomes available. The connection manager should be registered with any HttpConnection that is created.

Specified by:
getConnection in interface HttpConnectionManager
Parameters:
hostConfiguration - the host configuration to use to configure the connection
timeout - - the time (in milliseconds) to wait for a connection to become available, 0 to specify an infinite timeout
Returns:
an HttpConnection for the given configuraiton
Throws:
HttpException - if no connection becomes available before the timeout expires
See Also:
HttpConnection.setHttpConnectionManager(HttpConnectionManager)

getConnection

public HttpConnection getConnection(HostConfiguration hostConfiguration)
Description copied from interface: HttpConnectionManager
Gets an HttpConnection for a given host configuration. If a connection is not available this method will block until one is. The connection manager should be registered with any HttpConnection that is created.

Specified by:
getConnection in interface HttpConnectionManager
Parameters:
hostConfiguration - the host configuration to use to configure the connection
Returns:
an HttpConnection for the given configuration
See Also:
HttpConnection.setHttpConnectionManager(HttpConnectionManager)

releaseConnection

public void releaseConnection(HttpConnection conn)
Description copied from interface: HttpConnectionManager
Releases the given HttpConnection for use by other requests.

Specified by:
releaseConnection in interface HttpConnectionManager
Parameters:
conn - - The HttpConnection to make available.

getParams

public HttpConnectionManagerParams getParams()
Description copied from interface: HttpConnectionManager
Returns parameters associated with this connection manager.

Specified by:
getParams in interface HttpConnectionManager
See Also:
HttpConnectionManagerParams

setParams

public void setParams(HttpConnectionManagerParams params)
Description copied from interface: HttpConnectionManager
Assigns parameters for this connection manager.

Specified by:
setParams in interface HttpConnectionManager
See Also:
HttpConnectionManagerParams


Copyright © 2001-2004 Apache Software Foundation. All Rights Reserved.