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.RunnableTheRunnableDelegateobject is used to actually invoke therunmethod. 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.RunnabletaskThis is the runnable that is to be executed.
-
Constructor Summary
Constructors Constructor Description RunnableDelegate(java.lang.Runnable task)Constructor for theRunnableDelegateobject.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidrun()This is used to execute the task.
-
-
-
Constructor Detail
-
RunnableDelegate
public RunnableDelegate(java.lang.Runnable task)
Constructor for theRunnableDelegateobject. 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:
runin interfacejava.lang.Runnable
-
-