org.terrier.utility
Class KillHandler

java.lang.Object
  extended by java.lang.Thread
      extended by 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
static interface KillHandler.Killable
          Interface denoting an object which can be killed by the KillHandler
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
protected  KillHandler.Killable killable
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Method Summary
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, 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
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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 interface java.lang.Runnable
Overrides:
run in class java.lang.Thread


Terrier 3.5. Copyright © 2004-2011 University of Glasgow