public class ShutdownThread
extends java.lang.Thread
Modifier and Type | Field and Description |
---|---|
private boolean |
_hooked |
private java.util.List<LifeCycle> |
_lifeCycles |
private static ShutdownThread |
_thread |
private static Logger |
LOG |
Modifier | Constructor and Description |
---|---|
private |
ShutdownThread()
Default constructor for the singleton
Registers the instance as shutdown hook with the Java Runtime
|
Modifier and Type | Method and Description |
---|---|
static void |
deregister(LifeCycle lifeCycle) |
static ShutdownThread |
getInstance()
Returns the instance of the singleton
|
private void |
hook() |
static boolean |
isRegistered(LifeCycle lifeCycle) |
static void |
register(int index,
LifeCycle... lifeCycles) |
static void |
register(LifeCycle... lifeCycles) |
void |
run() |
private void |
unhook() |
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
private static final Logger LOG
private static final ShutdownThread _thread
private boolean _hooked
private final java.util.List<LifeCycle> _lifeCycles
private ShutdownThread()
private void hook()
private void unhook()
public static ShutdownThread getInstance()
ShutdownThread
public static void register(LifeCycle... lifeCycles)
public static void register(int index, LifeCycle... lifeCycles)
public static void deregister(LifeCycle lifeCycle)
public static boolean isRegistered(LifeCycle lifeCycle)
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread