org.apache.commons.httpclient.util
Class IdleConnectionTimeoutThread
Thread
org.apache.commons.httpclient.util.IdleConnectionTimeoutThread
public class IdleConnectionTimeoutThread
extends Thread
A utility class for periodically closing idle connections.
IdleConnectionTimeoutThread
public IdleConnectionTimeoutThread()
addConnectionManager
public void addConnectionManager(HttpConnectionManager connectionManager)
connectionManager
- The connection manager to add
removeConnectionManager
public void removeConnectionManager(HttpConnectionManager connectionManager)
Removes the connection manager from this class. The idle connections from the connection
manager will no longer be automatically closed by this class.
connectionManager
- The connection manager to remove
run
public void run()
Closes idle connections.
setConnectionTimeout
public void setConnectionTimeout(long connectionTimeout)
Sets the timeout value to use when testing for idle connections.
connectionTimeout
- The connection timeout in milliseconds
setTimeoutInterval
public void setTimeoutInterval(long timeoutInterval)
Sets the interval used by this class between closing idle connections. Idle
connections will be closed every timeoutInterval
milliseconds.
timeoutInterval
- The timeout interval in milliseconds
shutdown
public void shutdown()
Stops the thread used to close idle connections. This class cannot be used once shutdown.
Copyright (c) 1999-2005 - Apache Software Foundation