Package org.terrier.utility
Class KillHandler
- java.lang.Object
-
- java.lang.Thread
-
- org.terrier.utility.KillHandler
-
- All Implemented Interfaces:
java.lang.Runnable
public class KillHandler extends java.lang.Thread
Utility class for when releasing resources when the runtime system is shutting down.- Since:
- 3.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
KillHandler.Killable
Interface denoting an object which can be killed by the KillHandler
-
Field Summary
Fields Modifier and Type Field Description protected KillHandler.Killable
killable
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
addKillhandler(KillHandler.Killable object)
Add a Killable objects to the shutdown list which are invoked when the runtime system is terminating.static void
removeKillhandler(KillHandler.Killable object)
Remove a Killable objects from the shutdown list which are invoked when the runtime system is terminating.void
run()
-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
Field Detail
-
killable
protected final KillHandler.Killable killable
-
-
Method Detail
-
addKillhandler
public static void addKillhandler(KillHandler.Killable object)
Add a Killable objects to the shutdown list which are invoked when the runtime system is terminating.- Parameters:
object
- the object with the kill handler
-
removeKillhandler
public static void removeKillhandler(KillHandler.Killable object)
Remove a Killable objects from the shutdown list which are invoked when the runtime system is terminating.- Parameters:
object
- the object with the kill handler
-
run
public void run()
- Specified by:
run
in interfacejava.lang.Runnable
- Overrides:
run
in classjava.lang.Thread
-
-