public final class IdleConnectionReaper
extends java.lang.Thread
Modifier and Type | Field and Description |
---|---|
private static java.util.ArrayList<org.apache.http.conn.HttpClientConnectionManager> |
connectionManagers
The list of registered connection managers, whose connections
will be periodically checked and idle connections closed.
|
private static IdleConnectionReaper |
instance
Singleton instance of the connection reaper.
|
(package private) static org.apache.commons.logging.Log |
log
Shared log for any errors during connection reaping.
|
private static int |
PERIOD_MILLISECONDS
The period between invocations of the idle connection reaper.
|
private boolean |
shuttingDown
Set to true when shutting down the reaper; Once set to true, this
flag is never set back to false.
|
Modifier | Constructor and Description |
---|---|
private |
IdleConnectionReaper()
Private constructor - singleton pattern.
|
Modifier and Type | Method and Description |
---|---|
private void |
markShuttingDown() |
static boolean |
registerConnectionManager(org.apache.http.conn.HttpClientConnectionManager connectionManager)
Registers the given connection manager with this reaper;
|
static boolean |
removeConnectionManager(org.apache.http.conn.HttpClientConnectionManager connectionManager)
Removes the given connection manager from this reaper,
and shutting down the reaper if there is zero connection manager left.
|
void |
run() |
static boolean |
shutdown()
Shuts down the thread, allowing the class and instance to be collected.
|
(package private) static int |
size()
For testing purposes.
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
static final org.apache.commons.logging.Log log
private static final int PERIOD_MILLISECONDS
private static final java.util.ArrayList<org.apache.http.conn.HttpClientConnectionManager> connectionManagers
private static IdleConnectionReaper instance
private volatile boolean shuttingDown
private IdleConnectionReaper()
public static boolean registerConnectionManager(org.apache.http.conn.HttpClientConnectionManager connectionManager)
public static boolean removeConnectionManager(org.apache.http.conn.HttpClientConnectionManager connectionManager)
public static boolean shutdown()
static int size()
private void markShuttingDown()
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread