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
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: 2012-09-14 09:28:35 +0200 (fr, 14 sep 2012) $
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
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
Modifier and TypeMethodDescriptionprotected void
Add a signal to the list of supported signals.Get all signals that are supported by this handler.protected void
removeSignal
(Signal signal) Remove a signal from the list of supported signals.boolean
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 Details
-
supported
Holds the supported signals.
-
-
Constructor Details
-
AbstractSignalHandler
protected AbstractSignalHandler()Create a new signal handler, that initially doesn't support any signals at all. -
AbstractSignalHandler
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 Details
-
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
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
Add a signal to the list of supported signals.- Parameters:
signal
- The signal to add
-
removeSignal
Remove a signal from the list of supported signals.- Parameters:
signal
- The signal to remove
-