Class ThreadAction

java.lang.Object
org.apache.jena.system.ThreadAction

public class ThreadAction extends Object
An action that will happen on a different thread later when run() is called. A thread is created and started during a call to the {#link create()}. The associated Runnable is called when run() is called.
  • Method Details

    • run

      public void run()
      Perform the Runnable, reporting any RuntimeException or Error
    • create

      public static ThreadAction create(Runnable action)
      Create a ThreadAction.
      Parameters:
      action - The main action run when run() called.
      Returns:
      ThreadAction
    • create

      public static ThreadAction create(Runnable before, Runnable action, Runnable after)
      Create a ThreadAction.
      Parameters:
      before - Action to call as the thread starts before run(). Can be null.
      action - The main action run when run() called. Any exceptions are passed over to run() and propagated on the run() thread.
      after - Action to run after the main action. Can be null.
      Returns:
      ThreadAction