public abstract class AbstractSignalHandler extends Object implements SignalHandler
SignalHandler
interface
to provide information about supported signals. The easiest way is to
use the AbstractSignalHandler(Collection)
constructor.Modifier and Type | Field and Description |
---|---|
private Set<Signal> |
supported
Holds the supported signals.
|
Modifier | Constructor and 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.
|
Modifier and Type | Method and 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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
handleSignal
protected AbstractSignalHandler()
protected AbstractSignalHandler(Collection<Signal> supported)
supported
- A collection with the signals that are initially supported.
More signals can be added with addSignal(Signal)
public Collection<Signal> getSupportedSignals()
SignalHandler
getSupportedSignals
in interface SignalHandler
public boolean supports(Signal signal)
SignalHandler
supports
in interface SignalHandler
signal
- The signal to checkprotected void addSignal(Signal signal)
signal
- The signal to addprotected void removeSignal(Signal signal)
signal
- The signal to remove