Public Member Functions | |
| ShutdownHookBase (Logger logger, String processName) | |
| void | run () |
| void | setRegularShutdownExpected () |
Protected Member Functions | |
| void | regularTermination () |
| abstract void | interruptDetected () |
Protected Attributes | |
| volatile boolean | m_regularShutdownExpected = false |
| final Logger | logger |
| final String | processName |
Recommended reading: http://www-106.ibm.com/developerworks/ibm/library/i-signalhandling/ (also talks about signals for tougher mishaps than Ctrl-c). See also java.lang.Runtime#addShutdownHook(Thread)
Abstracted from the java container's shutdown hook, to simplify registering such hooks also in jlog etc.
|
||||||||||||
|
|
|
|
Is called when the JVM is about to terminate due to an interrupt signal. Subclasses should perform emergency cleanup. |
|
|
Subclasses can override this method to log nothing or something else. No other action is expected in the overridden method. |
|
|
|
|
|
Must be called right before the program ends. This helps the ShutdownHook to decide whether it's being called for a regular program termination or because of an interrupt. |
|
|
|
|
|
|
|
|
|
1.3.8