Class RunnableWEx<T>

java.lang.Object
com.polarion.core.util.RunnableWEx<T>
All Implemented Interfaces:
Runnable

public abstract class RunnableWEx<T> extends Object implements Runnable
Runnable which permits the execution of a set of operations that can throw exceptions and/or return a result.
It is used in many Polarion API calls, for example: com.polarion.platform.persistence.IDataService#doInBaseline(String, RunnableWEx)
When the run() method is used, the exceptions are handled, when the runWEx()("run with exception") method is used, the exceptions are propagated and can additionally return the results of the operations.
Author:
Roman Kratochvil, POLARION SOFTWARE
  • Constructor Details

    • RunnableWEx

      public RunnableWEx()
  • Method Details

    • wrap

      public static RunnableWEx wrap(Runnable r)
    • run

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

      public final T runWRet()
      Similar to the Runnable.run() method, but can return a result of the executed operations.
    • runWEx

      public abstract T runWEx() throws Exception
      Similar to the Runnable.run() method, but can return a result of the executed operations and the method can throw an exception.
      Throws:
      Exception