Class Future

java.lang.Object
ch.nolix.base.programcontrol.future.AbstractFuture
ch.nolix.base.programcontrol.flowcontrol.Future
All Implemented Interfaces:
IFuture, FinishRequestable

public final class Future extends AbstractFuture
Author:
Silvan Wyss
  • Method Details

    • forJobExecutor

      public static Future forJobExecutor(JobExecutor jobExecutor)
      Parameters:
      jobExecutor -
      Returns:
      a new Future with the given jobExecutor.
      Throws:
      RuntimeException - if the given jobExecutor is null.
    • caughtError

      public boolean caughtError()
      Returns:
      true if the current IFuture caught an error, false otherwise.
    • getError

      public Throwable getError()
      Returns:
      the error of the current IFuture.
    • getFinishedJobCount

      public int getFinishedJobCount()
      Returns:
      the number of finished jobs of the current IFuture.
    • isFinished

      public boolean isFinished()
      Returns:
      true if the current FinishRequestable is finished, false otherwise.
    • waitUntilIsFinished

      public void waitUntilIsFinished()
      Lets the current IFuture wait until it is finished.
    • waitUntilIsFinished

      public void waitUntilIsFinished(int timeoutInMilliseconds)
      Lets the current IFuture wait until it is finished within the given timeoutInMilliseconds.
      Parameters:
      timeoutInMilliseconds -