Thread.State, Thread.UncaughtExceptionHandler| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_IDLE_CONNECTION_MONITOR_THREAD_WAIT_TIME_IN_SECONDS |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Modifier and Type | Method and Description |
|---|---|
static void |
cleanStaleReferences()
Remove stale references that have been garbage-collected already.
|
void |
closeIdleConnections()
Close idle connections.
|
static IdleConnectionMonitor |
getInstance() |
int |
getWaitTimeInSeconds() |
static int |
idleConnectionMonitorThreadSize() |
boolean |
isIdleMonitorThreadShutdown() |
static boolean |
registerConnectionManager(org.apache.http.conn.HttpClientConnectionManager connectionManager,
int waitTimeInSeconds,
int idleTimeoutInSeconds)
Registers the connection manager with the IdleConnectionMonitor thread;
|
static boolean |
removeConnectionManager(org.apache.http.conn.HttpClientConnectionManager connectionManager)
Removes the connection manager from the IdleConnectionMonitor thread, and shuts down the
thread if there is no connection manager left.
|
void |
run() |
static boolean |
shutdown()
Stops the execution of IdleConnectionMonitor thread by shutting down the thread and clears
the connection managers in it.
|
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, yieldpublic static int DEFAULT_IDLE_CONNECTION_MONITOR_THREAD_WAIT_TIME_IN_SECONDS
public static boolean registerConnectionManager(org.apache.http.conn.HttpClientConnectionManager connectionManager,
int waitTimeInSeconds,
int idleTimeoutInSeconds)
Registers the connection manager with the IdleConnectionMonitor thread;
connectionManager - Connection manager to registerwaitTimeInSeconds - The maximum time interval after which the check and closing of
expired/idle connections is performed; this may happen more oftenidleTimeoutInSeconds - The idle timeout - close connections that have been idle longer
than idleTimeoutInSeconds secondstrue if the connection manager has been successfully registered; otherwise
false.public static boolean removeConnectionManager(org.apache.http.conn.HttpClientConnectionManager connectionManager)
Removes the connection manager from the IdleConnectionMonitor thread, and shuts down the thread if there is no connection manager left.
true if the connection manager has been successfully removed; otherwise
false.public void closeIdleConnections()
Close idle connections. As a side effect, updates the minimum wait time between checks.
public static void cleanStaleReferences()
Remove stale references that have been garbage-collected already.
public static boolean shutdown()
Stops the execution of IdleConnectionMonitor thread by shutting down the thread and clears the connection managers in it.
true if the shutdown process was initiated successfully, otherwise false.public static int idleConnectionMonitorThreadSize()
public int getWaitTimeInSeconds()
public boolean isIdleMonitorThreadShutdown()
public static IdleConnectionMonitor getInstance()
Copyright © 2016–2024. All rights reserved.