Class CoreShutdownHook

  extended by java.lang.Thread
      extended by org.aitools.programd.CoreShutdownHook
All Implemented Interfaces:

public class CoreShutdownHook
extends java.lang.Thread

Runs the shutdown method of a Core when it is started. This is intended to be attached via Runtime.addShutdownHook() for any configuration where it is possible that the entire system may exit. Of course this doesn't apply to many cases (such as if the Core is a component in an application server), so this may not always be used. When this class's run() method is called, it first checks that the Core has not been shut down already.

Noel Bush

Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
Field Summary
private  Core core
Fields inherited from class java.lang.Thread
Constructor Summary
CoreShutdownHook(Core aCore)
          Creates a new CoreShutdownHook to manage the shutdown of the given Core
Method Summary
 void run()
          Shuts down the Core assigned to this thread.
Methods inherited from class java.lang.Thread
activeCount, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, checkAccess, 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail


private Core core
Constructor Detail


public CoreShutdownHook(Core aCore)
Creates a new CoreShutdownHook to manage the shutdown of the given Core

aCore - the Core whose shutdown method should be run when this thread is run
Method Detail


public void run()
Shuts down the Core assigned to this thread.

Specified by:
run in interface java.lang.Runnable
run in class java.lang.Thread
See Also: