Package net.sf.basedb.core.signal
Class Signal
java.lang.Object
net.sf.basedb.core.signal.Signal
Represents a signal that can be sent to a class implementing the
SignalTarget
interface. Signals must be registered before they
can be used. Use getSignals()
to get a list of signals
that have been registered. A signal can only be registered once.- Version:
- 2.6
- Author:
- nicklas
- Last modified
- $Date: 2017-04-05 12:47:41 +0200 (on, 05 apr 2017) $
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Signal
The ABORT signal, that requests that the receiver should clean up and die.private final String
private final String
private final String
static final Signal
The PAUSE signal, that requests that the receiver should update the pause whatever it is doing and return control to the system.static final Signal
The SHUTDOWN signal, that requests that the receiver should clean up and die.Holds all registered signals.static final Signal
The STATUS signal, that requests that the receiver should update the status on the system. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Two signals are equal if they have the same ID.Get the description of the what the signal means and how receivers should behave when the signal is sent to themgetId()
Get the signal ID.getName()
Get the short name of the signal.static Signal
Get the signal with a given ID.static Collection<Signal>
Get all registered signals.int
hashCode()
The hashcode for a signal is the same as the hashcode for the ID.static Signal
registerSignal
(String id, String name, String description) Register a signal.toString()
-
Field Details
-
ABORT
The ABORT signal, that requests that the receiver should clean up and die. This signal is typically sent to a plug-in when the user manually requests that a job is aborted. It is also sent when the system is shutting down to plug-ins that doesn't support theSHUTDOWN
signal. -
SHUTDOWN
The SHUTDOWN signal, that requests that the receiver should clean up and die. When the system is up again the receiver may continue were it was stopped if supported. Otherwise, this signal should be treated asABORT
.- Since:
- 2.16
-
STATUS
The STATUS signal, that requests that the receiver should update the status on the system. This signal is typically sent to a job managed by an external job manager when someone on the BASE side want to have an update about the progress.- Since:
- 3.3
-
PAUSE
The PAUSE signal, that requests that the receiver should update the pause whatever it is doing and return control to the system.- Since:
- 3.11
-
signals
Holds all registered signals. -
id
-
name
-
description
-
-
Constructor Details
-
Signal
-
-
Method Details
-
registerSignal
Register a signal.- Parameters:
id
- The ID of the signal. This must be unique. If another signal with the same ID already exists, this method does nothing.name
- The short name of the signaldescription
- A description of the what the signal means and how receivers should behave when the signal is sent to them- Returns:
- The Signal object
-
getSignal
Get the signal with a given ID.- Parameters:
id
- The signal ID.- Returns:
- The Signal object, or null if no signal with the given ID has been registered
- See Also:
-
getSignals
Get all registered signals. The returned collection can't be modified.- Returns:
- A Collection with all registered signals
- See Also:
-
toString
-
equals
Two signals are equal if they have the same ID. -
hashCode
public int hashCode()The hashcode for a signal is the same as the hashcode for the ID. -
getId
Get the signal ID. The ID must be unique among all registered signals. -
getName
Get the short name of the signal. -
getDescription
Get the description of the what the signal means and how receivers should behave when the signal is sent to them
-