Package net.sf.basedb.core.signal
Class AbstractSignalHandler
- java.lang.Object
-
- net.sf.basedb.core.signal.AbstractSignalHandler
-
- All Implemented Interfaces:
SignalHandler
,Action
- 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 theSignalHandler
interface to provide information about supported signals. The easiest way is to use theAbstractSignalHandler(Collection)
constructor.- Version:
- 2.6
- Author:
- nicklas
- Last modified
- $Date: 2012-09-14 09:28:35 +0200 (fr, 14 sep 2012) $
-
-
Constructor Summary
Constructors Modifier Constructor Description 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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
-
-
-
-
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 withaddSignal(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 interfaceSignalHandler
- 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 interfaceSignalHandler
- 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
-
-