Project Wonder 2.0

er.extensions
Class ERXGracefulShutdown

java.lang.Object
  extended byer.extensions.ERXGracefulShutdown
All Implemented Interfaces:
sun.misc.SignalHandler

public class ERXGracefulShutdown
extends Object
implements sun.misc.SignalHandler

Graceful shutdown adds signal handling support for gracefully terminating a WOApplication. The default implementation in ERXApplication simply calls the terminate method. By default only the TERM and INT signals are registered to handle.


Nested Class Summary
static interface ERXGracefulShutdown.GracefulApplication
          Interface to be implemented by the WOApplication subclass to gracefully handle termination.
 
Field Summary
protected  sun.misc.SignalHandler defaultHandler
          caches the previous handler for chaining
static ERXLogger log
          logging support
 
Fields inherited from interface sun.misc.SignalHandler
SIG_DFL, SIG_IGN
 
Constructor Summary
ERXGracefulShutdown()
           
 
Method Summary
 sun.misc.SignalHandler defaultHandler()
           
 void handle(sun.misc.Signal signal)
          Signal handling method.
static void installHandler()
          Installs signal handlers for the given array of signals.
static boolean isEnabled()
          Determines if signal handling is enabled.
 void setDefaultHandler(sun.misc.SignalHandler value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

public static final ERXLogger log
logging support


defaultHandler

protected sun.misc.SignalHandler defaultHandler
caches the previous handler for chaining

Constructor Detail

ERXGracefulShutdown

public ERXGracefulShutdown()
Method Detail

isEnabled

public static boolean isEnabled()
Determines if signal handling is enabled. Defaults to false.

Returns:
if signal handling is enabled

installHandler

public static void installHandler()
Installs signal handlers for the given array of signals. Default signals to catch are TERM and INT. The previous handler is saved to chain back to if anything goes wrong with the graceful termination method.


handle

public void handle(sun.misc.Signal signal)
Signal handling method. Gracefully terminates the currently running WOApplication.

Specified by:
handle in interface sun.misc.SignalHandler
Parameters:
signal - to be handled

defaultHandler

public sun.misc.SignalHandler defaultHandler()
Returns:
the default handler

setDefaultHandler

public void setDefaultHandler(sun.misc.SignalHandler value)

Last updated: Do, Dez 9, 2004 • 12:46 PM CET

Copyright © 2002 – 2004 Project Wonder.