|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.exolab.jms.scheduler.SerialTask
A Runnable
implementation which may only be executed serially by the
Scheduler
.
Constructor Summary | |
SerialTask(java.lang.Runnable task,
Scheduler scheduler)
Construct a new SerialTask . |
Method Summary | |
void |
run()
Run the task. |
boolean |
schedule()
Schedule this to run. |
void |
stop()
Stop the task. |
java.lang.String |
toString()
Returns a stringified form of this, for debugging purposes. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public SerialTask(java.lang.Runnable task, Scheduler scheduler)
SerialTask
.task
- the task to executescheduler
- the schedulerMethod Detail |
public boolean schedule() throws java.lang.InterruptedException
If the task is currently running, it will be scheduled after it has completed.
true
if the task was scheduled; false
if the task is already scheduled, or is in the process of
stoppingjava.lang.InterruptedException
- if the task can't be scheduledpublic void run()
run
in interface java.lang.Runnable
public void stop()
This will wait for the task to complete before returning. If the task has been scheduled to run again, it will be cancelled.
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |