public abstract class ERXShutdownHook extends Thread
APPLICATION SHUTDOWN SEQUENCE COMPLETE
on a single line. After you see this line in the application's log file, you can be
pretty sure that the process is indeed terminated. This notification works even if
there are no other shutdown hooks registered, if you ensure that this class is
loaded at all, e.g. by calling the no-op useMe()
method somewhere
(ERXApplication
does this for you if you extend that).
Usage (e.g. in your Application class constructor):
new ERXShutdownHook() {
@Override
public void hook() {
// do something
}
};
-Der.extensions.ERXApplication.enableERXShutdownHook=false
Thread.State, Thread.UncaughtExceptionHandler
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
ERXShutdownHook()
Construct a new nameless shutdown hook and register it.
|
ERXShutdownHook(String hookName)
Construct a new named shutdown hook and register it.
|
Modifier and Type | Method and Description |
---|---|
abstract void |
hook()
This is where you implement what is supposed to be run at shutdown time.
|
static void |
initERXShutdownHook() |
void |
run() |
static void |
useMe()
Call this in your app constructor if you have no other shutdown hooks.
|
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
public ERXShutdownHook()
public ERXShutdownHook(String hookName)
hookName
- hook namepublic static void initERXShutdownHook()
public static void useMe()
ERXApplication
calls this, so no need to do this if you're extending that.public abstract void hook()
Copyright © 2002 – 2024 Project Wonder.