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.ThreadUtility 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 interfaceKillHandler.KillableInterface denoting an object which can be killed by the KillHandler
-
Field Summary
Fields Modifier and Type Field Description protected KillHandler.Killablekillable
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidaddKillhandler(KillHandler.Killable object)Add a Killable objects to the shutdown list which are invoked when the runtime system is terminating.static voidremoveKillhandler(KillHandler.Killable object)Remove a Killable objects from the shutdown list which are invoked when the runtime system is terminating.voidrun()-
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:
runin interfacejava.lang.Runnable- Overrides:
runin classjava.lang.Thread
-
-