Interface IFuture

All Superinterfaces:
FinishRequestable
All Known Subinterfaces:
IImageGenerator, IResultFuture<R>
All Known Implementing Classes:
AbstractFuture, Future, Future, ImageGenerator, ResultFuture

public interface IFuture extends FinishRequestable
A IFuture is supposed to be given back when a job is started in background. A IFuture can always be asked if the background job has finished or thrown an error.
Author:
Silvan Wyss
  • Method Details

    • caughtError

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

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

      boolean isFinishedSuccessfully()
      Returns:
      true if the current IFuture is finished successfully, false otherwise.
    • isFinishedWithError

      boolean isFinishedWithError()
      Returns:
      true if the current IFuture is finished with an error, false otherwise.
    • waitUntilIsFinished

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

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

      void waitUntilIsFinishedSuccessfully()
      Lets the current IFuture wait until it is finished successfully.
      Throws:
      RuntimeException - if the current IFuture catches an error.
    • waitUntilIsFinishedSuccessfully

      void waitUntilIsFinishedSuccessfully(int timeoutInMilliseconds)
      Lets the current IFuture wait until it is finished successfully within the given timeoutInMilliseconds.
      Parameters:
      timeoutInMilliseconds -
      Throws:
      RuntimeException - if the current IFuture catches an error.
      RuntimeException - if the current IFuture reached the given timeoutInMilliseconds before having finished.