Class Daemon.RunnableDelegate

java.lang.Object
org.simpleframework.common.thread.Daemon.RunnableDelegate
All Implemented Interfaces:
Runnable
Enclosing class:
Daemon

private class Daemon.RunnableDelegate extends Object implements Runnable
The RunnableDelegate object is used to actually invoke the run method. A delegate is used to ensure that once the task has finished it is inactive so that it can be started again with a new thread.
  • Field Details

    • task

      private final Runnable task
      This is the runnable that is to be executed.
  • Constructor Details

    • RunnableDelegate

      public RunnableDelegate(Runnable task)
      Constructor for the RunnableDelegate object. The delegate requires the actual runnable that is to be executed. As soon as the task has finished the runner becomes inactive.
      Parameters:
      task - this is the task to be executed
  • Method Details

    • run

      public void run()
      This is used to execute the task. Once the task has finished the runner becomes inactive and any reference to the internal thread is set to null. This ensures the runner can be started again at a later time if desired.
      Specified by:
      run in interface Runnable