2.17.2: 2011-06-17

net.sf.basedb.core.signal
Class AbstractSignalHandler

java.lang.Object
  extended by net.sf.basedb.core.signal.AbstractSignalHandler
All Implemented Interfaces:
SignalHandler
Direct Known Subclasses:
DelegatingSignalHandler, EnhancedThreadSignalHandler, ForwardingSignalHandler, ProgressReporterSignalHandler, ThreadSignalHandler

public abstract class AbstractSignalHandler
extends Object
implements SignalHandler

An abstract base class for signal handler implementations. This class will help an implementor of the SignalHandler interface to provide information about supported signals. The easiest way is to use the AbstractSignalHandler(Collection) constructor.

Version:
2.6
Author:
nicklas
Last modified
$Date: 2008-09-11 22:09:17 +0200 (Thu, 11 Sep 2008) $

Field Summary
private  Set<Signal> supported
          Holds the supported signals.
 
Constructor Summary
protected AbstractSignalHandler()
          Create a new signal handler, that initially doesn't support any signals at all.
protected AbstractSignalHandler(Collection<Signal> supported)
          Create a new signal handler that supports the given signals.
 
Method Summary
protected  void addSignal(Signal signal)
          Add a signal to the list of supported signals.
 Collection<Signal> getSupportedSignals()
          Get all signals that are supported by this handler.
protected  void removeSignal(Signal signal)
          Remove a signal from the list of supported signals.
 boolean supports(Signal signal)
          Check if a given signal is supported.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.basedb.core.signal.SignalHandler
handleSignal
 

Field Detail

supported

private Set<Signal> supported
Holds the supported signals.

Constructor Detail

AbstractSignalHandler

protected AbstractSignalHandler()
Create a new signal handler, that initially doesn't support any signals at all.


AbstractSignalHandler

protected AbstractSignalHandler(Collection<Signal> supported)
Create a new signal handler that supports the given signals.

Parameters:
supported - A collection with the signals that are initially supported. More signals can be added with addSignal(Signal)
Method Detail

getSupportedSignals

public Collection<Signal> getSupportedSignals()
Description copied from interface: SignalHandler
Get all signals that are supported by this handler.

Specified by:
getSupportedSignals in interface SignalHandler
Returns:
A collection of signals

supports

public boolean supports(Signal signal)
Description copied from interface: SignalHandler
Check if a given signal is supported.

Specified by:
supports in interface SignalHandler
Parameters:
signal - The signal to check
Returns:
TRUE if the signal is supported, FALSE otherwise

addSignal

protected void addSignal(Signal signal)
Add a signal to the list of supported signals.

Parameters:
signal - The signal to add

removeSignal

protected void removeSignal(Signal signal)
Remove a signal from the list of supported signals.

Parameters:
signal - The signal to remove

2.17.2: 2011-06-17