public class ActivityWatchdog extends Thread
Daemon thread watching a list of active objects.
The watchdog will wake up every WAKE_UP_INTERVAL milliseconds and check the active objects last activity timestamps. If an active object has been inactive for too long, its associated timeout callback is called.
The activity watchdog is a singleton.
ActiveObjectThread.State, Thread.UncaughtExceptionHandlerMAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Modifier and Type | Method and Description |
|---|---|
static ActivityWatchdog |
getInstance()
Get the singleton instance
|
void |
pleaseStop()
Ask the watchdog thread to stop
|
void |
register(ActiveObject object)
Register an active object to be monitored
|
void |
run() |
void |
unregister(ActiveObject object)
Unregister a monitored active object
|
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 ActivityWatchdog getInstance()
public void pleaseStop()
public void register(ActiveObject object)
object - the object to registerpublic void unregister(ActiveObject object)
object - the object to unregisterCopyright © 2021. All rights reserved.