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 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 Details

    • supported

      private Set<Signal> 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

      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 Details

    • 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