Class Daemon.RunnableDelegate
- java.lang.Object
-
- org.simpleframework.common.thread.Daemon.RunnableDelegate
-
- All Implemented Interfaces:
java.lang.Runnable
- Enclosing class:
- Daemon
private class Daemon.RunnableDelegate extends java.lang.Object implements java.lang.Runnable
TheRunnableDelegate
object is used to actually invoke therun
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 Summary
Fields Modifier and Type Field Description private java.lang.Runnable
task
This is the runnable that is to be executed.
-
Constructor Summary
Constructors Constructor Description RunnableDelegate(java.lang.Runnable task)
Constructor for theRunnableDelegate
object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
run()
This is used to execute the task.
-
-
-
Constructor Detail
-
RunnableDelegate
public RunnableDelegate(java.lang.Runnable task)
Constructor for theRunnableDelegate
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 Detail
-
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 interfacejava.lang.Runnable
-
-