Klasse FlowController
java.lang.Object
ch.nolix.core.programcontrol.flowcontrol.FlowController
The
FlowController provides methods for flow control.
Of the FlowController an instance cannot be created.- Version:
- 2016-06-01
- Autor:
- Silvan Wyss
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic IAsLongAsMediatorasLongAs(BooleanSupplier condition) static IAsSoonAsMediatorasSoonAs(BooleanSupplier condition) static IAsSoonAsMediatorasSoonAsNoMore(BooleanSupplier condition) static IFutureEnqueues the given job.static IForCountMediatorforCount(int maxRunCount) static IForMaxMillisecondsMediatorforMaxMilliseconds(int maxDurationInMilliseconds) static IForMaxMillisecondsMediatorforMaxSeconds(int maxDurationInSeconds) static IFuturerunInBackground(Runnable job) Runs the given job in background.static <R> IResultFuture<R> runInBackground(Supplier<R> resultJob) Runs the given result job in background.static IFuturerunInBackgroundAndOrder(Runnable job, Runnable... jobs) Runs the given jobs in background in the given order.static voidRuns the given job in an enclosed mode.static booleanRuns the given job in an enclosed mode.static IAsLongAsMediatoruntil(BooleanSupplier condition) static IWaitMediatorwaitAsLongAs(BooleanSupplier condition) Waits as long as the given condition is fulfilled.static IWaitMediatorwaitForMilliseconds(int durationInMilliseconds) Waits for the given durationInMilliseconds.static IWaitMediatorwaitForSeconds(int durationInSeconds) Waits for the given durationInSeconds.static IWaitMediatorwaitUntil(BooleanSupplier condition) Waits until the given condition is fulfilled.
-
Methodendetails
-
asLongAs
- Parameter:
condition-- Gibt zurück:
- a new
IAsLongAsMediatorwith the given condition. - Löst aus:
ArgumentIsNullException- if the given condition is null.
-
asSoonAs
- Parameter:
condition-- Gibt zurück:
- a new
IAsSoonAsMediatorwith the given condition. - Löst aus:
ArgumentIsNullException- if the given condition is null.
-
asSoonAsNoMore
- Parameter:
condition-- Gibt zurück:
- a new
IAsSoonAsMediatorwith 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
IFuturefor the given job. - Löst aus:
ArgumentIsNullException- if the given job is null.
-
forCount
- Parameter:
maxRunCount-- Gibt zurück:
- a new
IForCountMediatorwith the given maxRunCount. - Löst aus:
NegativeArgumentException- if the given maxRunCount is negative.
-
forMaxMilliseconds
- Parameter:
maxDurationInMilliseconds-- Gibt zurück:
- a new
IForMaxMillisecondsMediatorfor the given maxDurationInMilliseconds. - Löst aus:
NegativeArgumentException- if the given maxDurationInMilliseconds is negative.
-
forMaxSeconds
- Parameter:
maxDurationInSeconds-- Gibt zurück:
- a new
IForMaxMillisecondsMediatorfor 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
IFuturefor the execution of the given job. - 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
IFuturefor 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 of the given resultJob.- Parameter:
resultJob-- Gibt zurück:
- a new
IResultFuturefor the execution of the given resultJob. - Löst aus:
ArgumentIsNullException- if the given resultJob is null.
-
runInEnclosedMode
Runs the given job in an enclosed mode. Prints out the stack trace of any occurring error. An error will occur it the given job is null or if the given job will not run properly.- Parameter:
job-
-
runInEnclosedModeAndGetSuccessFlag
Runs the given job in an enclosed mode. Prints out the stack trace of any occurring error. An error will occur it the given job is null or if the given job will not run properly.- Parameter:
job-- Gibt zurück:
- true if the given job runs successfully, false otherwise.
-
until
- Parameter:
condition-- Gibt zurück:
- a new
IAsLongAsMediatorfor 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
IWaitMediator. - Löst aus:
ArgumentIsNullException- if the given condition is null.
-
waitForMilliseconds
Waits for the given durationInMilliseconds.- Parameter:
durationInMilliseconds-- Gibt zurück:
- a new
IWaitMediator. - Löst aus:
NegativeArgumentException- if the given durationInMilliseconds is negative.
-
waitForSeconds
Waits for the given durationInSeconds.- Parameter:
durationInSeconds-- Gibt zurück:
- a new
IWaitMediator. - Löst aus:
NegativeArgumentException- if the given durationInSeconds is negative.
-
waitUntil
Waits until the given condition is fulfilled.- Parameter:
condition-- Gibt zurück:
- a new
IWaitMediator. - Löst aus:
ArgumentIsNullException- if the given condition is null.
-