Interface SignalHandler

All Superinterfaces:
All Known Implementing Classes:
AbstractSignalHandler, DelegatingSignalHandler, EnhancedThreadSignalHandler, ForwardingSignalHandler, ProgressReporterSignalHandler, ThreadSignalHandler

public interface SignalHandler
extends Action
A signal handler is an object that is able to receive and act on signals. A specific signal handler instance may only support a subset of all registered signals (see Signal.getSignals()). A signal handler is usually created by a SignalTarget. When the handler receives a signal, it should in most cases notify the target about it. How this is done is up to each implementation.

Signal handler implementations need to be implemented in a thread safe. Once they have been registered with a SignalReceiver they may receive multiple signals in different threads at the same time.

Last modified
$Date: 2014-03-14 08:23:38 +0100 (fr, 14 mar 2014) $
  • Method Details

    • handleSignal

      void handleSignal​(Signal signal)
      Handle the given signal. It is recommended that signals are handled as quickly as possible. If there is a risk that it may take a long time it is recommended to spawn a new thread and handle the signal asynchronously.
      signal - The signal to handle
      UnsupportedSignalException - If the signal is not supported
    • getSupportedSignals

      Collection<Signal> getSupportedSignals()
      Get all signals that are supported by this handler.
      A collection of signals
    • supports

      boolean supports​(Signal signal)
      Check if a given signal is supported.
      signal - The signal to check
      TRUE if the signal is supported, FALSE otherwise