ariba.util.core
Class SignalHandler

java.lang.Object
  extended by ariba.util.core.SignalHandler
All Implemented Interfaces:
sun.misc.SignalHandler

public abstract class SignalHandler
extends java.lang.Object
implements sun.misc.SignalHandler

Wrapper around the sun.misc.SignalHandler to avoid having the rest of the application to depend on this undocumented class and as such can be changed in any Java release. Note that this implementation guarantees that if another handler was registered for the same signal, it will be invoked after this one. In other words, you can register multiple handlers for the same signal in the reverse order in which you want them to be invoked.


Field Summary
 
Fields inherited from interface sun.misc.SignalHandler
SIG_DFL, SIG_IGN
 
Constructor Summary
SignalHandler()
           
 
Method Summary
 void handle(sun.misc.Signal signal)
          Method from the sun's interface which is called to handle a signal.
static void raiseSignal(java.lang.String signalName)
          Raises a signal in the current process.
static SignalHandler registerSignalHandler(SignalHandler handler, java.lang.String signalName)
          Registers the given SignalHandler for the given signal Note: an handler can be registered for only one signal !
Note: this method is not thread safe
static SignalHandler registerSignalHandler(java.lang.String className, java.lang.String signalName)
          Registers a new SignalHandler for the given signal name Note: this method is not thread safe
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SignalHandler

public SignalHandler()
Method Detail

registerSignalHandler

public static SignalHandler registerSignalHandler(java.lang.String className,
                                                  java.lang.String signalName)
Registers a new SignalHandler for the given signal name Note: this method is not thread safe

Parameters:
className - name of the subclass of SignalHandler
signalName - the name of the signal handled
Returns:
the newly registered SignalHandler, or null if the registration did not succeed.

registerSignalHandler

public static SignalHandler registerSignalHandler(SignalHandler handler,
                                                  java.lang.String signalName)
Registers the given SignalHandler for the given signal Note: an handler can be registered for only one signal !
Note: this method is not thread safe

Parameters:
handler - the handler to register
signalName - the signal to register with
Returns:
the handler which has been registered or null

raiseSignal

public static void raiseSignal(java.lang.String signalName)
Raises a signal in the current process.

Parameters:
signalName - the name of the signal to raise

handle

public final void handle(sun.misc.Signal signal)
Method from the sun's interface which is called to handle a signal. Our implementation guarantees that if another handler was registered for the same signal, it will be invoked after this.

Specified by:
handle in interface sun.misc.SignalHandler


AribaWeb User Interface Development Framework
Copyright © 2000-2014 Ariba, Inc. All Rights Reserved.