public class SignalApiImpl extends Object implements SignalApi
Modifier and Type | Field and Description |
---|---|
static String |
READY_PREFIX |
Constructor and Description |
---|
SignalApiImpl(String originator,
TaskId taskId,
SynchronizationInternal synchronizationInternal) |
Modifier and Type | Method and Description |
---|---|
String |
checkForSignals(Set<String> signalsSubSet)
Check if any of the signals given as input exist among the set of job signals
|
void |
clearJobSignals()
Remove the entry corresponding to job signals from the signals channel
|
Set<String> |
getJobSignals()
Return the set of job signals
|
boolean |
isReceived(String signalName)
Check if the given signal exists among the set of job signals
|
boolean |
readyForSignal(String signalName)
Add a new signal to the set of job signals
The new signal is composed of a prefix (i.e., "ready_") and the given signal
|
boolean |
removeManySignals(Set<String> signalsSubSet)
Remove the given set of signals from job signals
|
boolean |
removeSignal(String signalName)
Remove the given
signal from the set of job signals |
boolean |
sendManySignals(Set<String> signalsSubSet)
Add the given set of signals to job signals
|
boolean |
sendSignal(String signalName)
Add the given
signal to the set of job signals |
void |
waitFor(String signalName)
Wait until the given signal is added to the set of job signals
|
void |
waitForAll(Set<String> signalsSubSet)
Wait until all the input signals are added to the set of job signals
|
String |
waitForAny(Set<String> signalsSubSet)
Wait until one signal (among those of the given
signalsSubSet ) is added to the set of job signals |
public static final String READY_PREFIX
public SignalApiImpl(String originator, TaskId taskId, SynchronizationInternal synchronizationInternal)
public boolean readyForSignal(String signalName) throws SignalApiException
SignalApi
readyForSignal
in interface SignalApi
signalName
- name of the signal to be addedSignalApiException
- if an error occurred while reading in the signals channel, or when adding the ready signal to job signalspublic boolean isReceived(String signalName) throws SignalApiException
SignalApi
isReceived
in interface SignalApi
signalName
- name of the signal to be checkedSignalApiException
- if an error occurred while reading in the signals channelpublic String checkForSignals(Set<String> signalsSubSet) throws SignalApiException
SignalApi
checkForSignals
in interface SignalApi
signalsSubSet
- set of the signals to be checkedSignalApiException
- if an error occurred while reading in the signals channelpublic boolean sendSignal(String signalName) throws SignalApiException
SignalApi
signal
to the set of job signalssendSignal
in interface SignalApi
signalName
- name of the signal to be added to job signalsSignalApiException
- if the corresponding ready signal does not exist, or when an error occurs while sending the signalpublic boolean sendManySignals(Set<String> signalsSubSet) throws SignalApiException
SignalApi
sendManySignals
in interface SignalApi
signalsSubSet
- set of the signals to be added to job signalsSignalApiException
- if an error occurred while reading in the signals channel, or when adding the signals to job signalspublic boolean removeSignal(String signalName) throws SignalApiException
SignalApi
signal
from the set of job signalsremoveSignal
in interface SignalApi
signalName
- name of the signal to be removed from job signalsSignalApiException
- if an error occurred while reading in the signals channel, or when removing the signal from job signalspublic boolean removeManySignals(Set<String> signalsSubSet) throws SignalApiException
SignalApi
removeManySignals
in interface SignalApi
signalsSubSet
- set of the signals to be removed from job signalsSignalApiException
- if an error occurred while reading in the signals channel, or when removing the signals from job signalspublic Set<String> getJobSignals() throws SignalApiException
SignalApi
getJobSignals
in interface SignalApi
SignalApiException
- if an error occurred while reading in the signals channelpublic void clearJobSignals() throws SignalApiException
SignalApi
clearJobSignals
in interface SignalApi
SignalApiException
- if an error occurred while reading in the signals channel, or when removing an entry from this channelpublic void waitFor(String signalName) throws SignalApiException
SignalApi
waitFor
in interface SignalApi
signalName
- name of the signal to wait forSignalApiException
- if an error occurred while reading in the signals channelpublic String waitForAny(Set<String> signalsSubSet) throws SignalApiException
SignalApi
signalsSubSet
) is added to the set of job signalswaitForAny
in interface SignalApi
signalsSubSet
- set of the signals to wait for any of themSignalApiException
- if an error occurred while reading in the signals channelpublic void waitForAll(Set<String> signalsSubSet) throws SignalApiException
SignalApi
waitForAll
in interface SignalApi
signalsSubSet
- set of the signals to wait forSignalApiException
- if an error occurred while reading in the signals channel