Klasse GlobalSequencer
java.lang.Object
ch.nolix.core.programcontrol.sequencer.GlobalSequencer
The
GlobalSequencer
provides methods for flow control. Of the
GlobalSequencer
an instance cannot be created.- Version:
- 2016-06-01
- Autor:
- Silvan Wyss
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic AsLongAsMediator
asLongAs
(BooleanSupplier condition) static AsSoonAsMediator
asSoonAs
(BooleanSupplier condition) static AsSoonAsMediator
asSoonAsNoMore
(BooleanSupplier condition) static IFuture
Enqueues the given job.static ForCountMediator
forCount
(int maxRunCount) static ForMaxMillisecondsMediator
forMaxMilliseconds
(int maxDurationInMilliseconds) static ForMaxMillisecondsMediator
forMaxSeconds
(int maxDurationInSeconds) static Future
runInBackground
(Runnable job) Runs the given job in background.static <R> ResultFuture
<R> runInBackground
(Supplier<R> resultJob) Runs the given result job in background.static IFuture
runInBackgroundAndOrder
(Runnable job, Runnable... jobs) Runs the given jobs in background in the given order.static AsLongAsMediator
until
(BooleanSupplier condition) static ActionMediator
waitAsLongAs
(BooleanSupplier condition) Waits as long as the given condition is fulfilled.static ActionMediator
waitForMilliseconds
(int durationInMilliseconds) Waits for the given durationInMilliseconds.static ActionMediator
waitForSeconds
(int durationInSeconds) Waits for the given durationInSeconds.static ActionMediator
waitUntil
(BooleanSupplier condition) Waits until the given condition is fulfilled.
-
Methodendetails
-
asLongAs
- Parameter:
condition
-- Gibt zurück:
- a new
AsLongAsMediator
with the given condition. - Löst aus:
ArgumentIsNullException
- if the given condition is null.
-
asSoonAs
- Parameter:
condition
-- Gibt zurück:
- a new
AsSoonAsMediator
with the given condition. - Löst aus:
ArgumentIsNullException
- if the given condition is null.
-
asSoonAsNoMore
- Parameter:
condition
-- Gibt zurück:
- a new
AsSoonAsMediator
with the negation of the given condition. - Löst aus:
ArgumentIsNullException
- if the given condition is null.
-
enqueue
Enqueues the given job.- Parameter:
job
-- Gibt zurück:
- a
IFuture
for the given job. - Löst aus:
ArgumentIsNullException
- if the given job is null.
-
forCount
- Parameter:
maxRunCount
-- Gibt zurück:
- a new
ForCountMediator
with the given max run count. - Löst aus:
NegativeArgumentException
- if the given max run count is negative.
-
forMaxMilliseconds
- Parameter:
maxDurationInMilliseconds
-- Gibt zurück:
- a new
ForMaxMillisecondsMediator
for the given maxDurationInMilliseconds. - Löst aus:
NegativeArgumentException
- if the given maxDurationInMilliseconds is negative.
-
forMaxSeconds
- Parameter:
maxDurationInSeconds
-- Gibt zurück:
- a new
ForMaxMillisecondsMediator
for the given maxDurationInSeconds. - Löst aus:
NegativeArgumentException
- if the given maxDurationInSeconds is negative.
-
runInBackground
Runs the given job in background.- Parameter:
job
-- Gibt zurück:
- a new
Future
. - Löst aus:
ArgumentIsNullException
- if the given job is null.
-
runInBackgroundAndOrder
Runs the given jobs in background in the given order.- Parameter:
job
-jobs
-- Gibt zurück:
- a new
IFuture
for the running of the given jobs.
-
runInBackground
Runs the given result job in background. A result job is a job that returns a result.- Typparameter:
R
- is the type of the result the given resultJob returns.- Parameter:
resultJob
-- Gibt zurück:
- a new
ResultFuture
. - Löst aus:
ArgumentIsNullException
- if the given result job is null.
-
until
- Parameter:
condition
-- Gibt zurück:
- a new
AsLongAsMediator
for the negation of the given condition. - Löst aus:
ArgumentIsNullException
- if the given condition is null.
-
waitAsLongAs
Waits as long as the given condition is fulfilled.- Parameter:
condition
-- Gibt zurück:
- a
ActionMediator
. - Löst aus:
ArgumentIsNullException
- if the given condition is null.
-
waitForMilliseconds
Waits for the given durationInMilliseconds.- Parameter:
durationInMilliseconds
-- Gibt zurück:
- a
ActionMediator
. - Löst aus:
NegativeArgumentException
- if the given durationInMilliseconds is negative.
-
waitForSeconds
Waits for the given durationInSeconds.- Parameter:
durationInSeconds
-- Gibt zurück:
- a
ActionMediator
. - Löst aus:
NegativeArgumentException
- if the given durationInSeconds is negative.
-
waitUntil
Waits until the given condition is fulfilled.- Parameter:
condition
-- Gibt zurück:
- a
ActionMediator
. - Löst aus:
ArgumentIsNullException
- if the given condition is null.
-