Class RunnableWithResult<T>

java.lang.Object
org.eclipse.ease.tools.RunnableWithResult<T>
All Implemented Interfaces:
Runnable

public abstract class RunnableWithResult<T> extends Object implements Runnable
  • Constructor Details

    • RunnableWithResult

      public RunnableWithResult()
  • Method Details

    • run

      public final void run()
      Specified by:
      run in interface Runnable
    • getResult

      public T getResult() throws RuntimeException
      Get the result of the run execution. In case an exception was thrown it gets rethrown encapsulated in a RuntimeException.
      Returns:
      runnable result
      Throws:
      RuntimeException - encapsulated exception encountered during run
    • getResultOrThrow

      public T getResultOrThrow() throws Throwable
      Get the result of the run execution. Does rethrow exceptions that occurred during the run.
      Returns:
      runnable result
      Throws:
      RuntimeException - encapsulated exception encountered during run
      Throwable
    • runWithTry

      public abstract T runWithTry() throws Throwable
      Run method to be implemented by the derived class. Exceptions thrown will automatically get caught an rethrown on a getResult().
      Throws:
      Throwable