Class ThreadAction


  • public class ThreadAction
    extends java.lang.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 Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static ThreadAction create​(java.lang.Runnable action)
      Create a ThreadAction.
      static ThreadAction create​(java.lang.Runnable before, java.lang.Runnable action, java.lang.Runnable after)
      Create a ThreadAction.
      void run()
      Perform the Runnable, reporting any RuntimeException or Error
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • run

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

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

        public static ThreadAction create​(java.lang.Runnable before,
                                          java.lang.Runnable action,
                                          java.lang.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