|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sourceforge.acelogger.execution.task.MonitorableTask
public class MonitorableTask

A Runnable implementation and a wrapper that supports monitoring of the execution status
and a utility methods to await the task completion or a given timeout, what occurs first.
| Field Summary | |
|---|---|
static int |
DEFAULT_MAXIMUM_STEP
The default value (in ms) for the maximum step used in termination waiting methods. |
| Constructor Summary | |
|---|---|
MonitorableTask(Runnable task)
Constructs a new MonitorableTask for the given Runnable. |
|
| Method Summary | |
|---|---|
boolean |
awaitTermination(long duration)
Waits for task completion or waiting timeout, what occurs first. |
boolean |
awaitTermination(long duration,
long maximumStep)
Waits for task completion or waiting timeout, what occurs first. |
boolean |
isDone()
Signals the termination of this task execution. |
void |
run()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFAULT_MAXIMUM_STEP
| Constructor Detail |
|---|
public MonitorableTask(Runnable task)
Runnable.
task - The Runnable that will be monitored.| Method Detail |
|---|
public void run()
run in interface Runnablepublic boolean isDone()
public boolean awaitTermination(long duration)
throws InterruptedException
DEFAULT_MAXIMUM_STEP.
duration - The maximum duration of the waiting process, in milliseconds.
InterruptedException - If the execution thread was interrupted during the waiting process.awaitTermination(long, long)
public boolean awaitTermination(long duration,
long maximumStep)
throws InterruptedException
duration - The maximum duration of the waiting process, in milliseconds.maximumStep - The maximum step during the waiting process, in milliseconds.
InterruptedException - If the execution thread was interrupted during the waiting process.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||