Class Future
java.lang.Object
ch.nolix.base.programcontrol.future.AbstractFuture
ch.nolix.base.programcontrol.flowcontrol.Future
- All Implemented Interfaces:
IFuture, FinishRequestable
- Author:
- Silvan Wyss
-
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic FutureforJobExecutor(JobExecutor jobExecutor) getError()intbooleanvoidLets the currentIFuturewait until it is finished.voidwaitUntilIsFinished(int timeoutInMilliseconds) Lets the currentIFuturewait until it is finished within the given timeoutInMilliseconds.Methods inherited from class AbstractFuture
isFinishedSuccessfully, isFinishedWithError, waitUntilIsFinishedSuccessfully, waitUntilIsFinishedSuccessfullyMethods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface FinishRequestable
isRunning
-
Method Details
-
forJobExecutor
- Parameters:
jobExecutor-- Returns:
- a new
Futurewith the given jobExecutor. - Throws:
RuntimeException- if the given jobExecutor is null.
-
caughtError
public boolean caughtError()- Returns:
- true if the current
IFuturecaught an error, false otherwise.
-
getError
-
getFinishedJobCount
public int getFinishedJobCount()- Returns:
- the number of finished jobs of the current
IFuture.
-
isFinished
public boolean isFinished()- Returns:
- true if the current
FinishRequestableis finished, false otherwise.
-
waitUntilIsFinished
public void waitUntilIsFinished()Lets the currentIFuturewait until it is finished. -
waitUntilIsFinished
public void waitUntilIsFinished(int timeoutInMilliseconds) Lets the currentIFuturewait until it is finished within the given timeoutInMilliseconds.- Parameters:
timeoutInMilliseconds-
-