isc.util
Class ServerShutdownHook

java.lang.Object
  extended by java.lang.Thread
      extended by isc.util.ServerShutdownHook
All Implemented Interfaces:
java.lang.Runnable

public class ServerShutdownHook
extends java.lang.Thread

Catch ^c, kill or other JVM shutdown signals and allow the application to shutdown gracefully by calling local ServerAdmin shu

Author:
John Casey
Project: DNA_sensor - Dec, 2005

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
(package private)  ServerAdmin _admin
           
protected  java.lang.Boolean _running
           
protected static org.apache.log4j.Logger log
          log4j
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ServerShutdownHook(ServerAdmin admin)
          Initialize shutdown hook.
 
Method Summary
 void run()
          Sleep until JVM calls during shutdown.
 void setFinish()
          The main routine should call this before exiting.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

protected static org.apache.log4j.Logger log
log4j


_running

protected java.lang.Boolean _running

_admin

ServerAdmin _admin
Constructor Detail

ServerShutdownHook

public ServerShutdownHook(ServerAdmin admin)
Initialize shutdown hook. pass the server's admin inteface

Parameters:
admin -
Method Detail

run

public void run()
Sleep until JVM calls during shutdown.

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

setFinish

public void setFinish()
The main routine should call this before exiting.