2.17.2: 2011-06-17

net.sf.basedb.core.signal
Interface SignalHandler

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

public interface SignalHandler

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.

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

Method Summary
 Collection<Signal> getSupportedSignals()
          Get all signals that are supported by this handler.
 void handleSignal(Signal signal)
          Handle the given signal.
 boolean supports(Signal signal)
          Check if a given signal is supported.
 

Method Detail

handleSignal

void handleSignal(Signal signal)
Handle the given signal.

Parameters:
signal - The signal to handle
Throws:
UnsupportedSignalException - If the signal is not supported

getSupportedSignals

Collection<Signal> getSupportedSignals()
Get all signals that are supported by this handler.

Returns:
A collection of signals

supports

boolean supports(Signal signal)
Check if a given signal is supported.

Parameters:
signal - The signal to check
Returns:
TRUE if the signal is supported, FALSE otherwise

2.17.2: 2011-06-17