|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.rice.cs.plt.concurrent.TaskController<R>
edu.rice.cs.plt.concurrent.PollingTaskController<R>
public abstract class PollingTaskController<R>
A TaskController for tasks that are run without any facility for executing code when the task
is complete — instead, the controller must either block, poll for the task's current status.
When most of the controller's methods are invoked, the current status is polled before proceeding;
operations depending on completion block (finishListeners() are handled by blocking in a new
daemon thread).
To implement a concrete instance, a subclass must provide TaskController.doStart(), TaskController.doStop(),
update(), finish(), and, optionally, TaskController.discard().
| Nested Class Summary | |
|---|---|
protected class |
PollingTaskController.PollingCancelingState
CancelingState variant based on a PollingRunner. |
protected class |
PollingTaskController.PollingRunningState
RunningState variant based on a PollingRunner. |
| Field Summary |
|---|
| Fields inherited from class edu.rice.cs.plt.concurrent.TaskController |
|---|
state |
| Constructor Summary | |
|---|---|
protected |
PollingTaskController()
|
| Method Summary | |
|---|---|
protected abstract void |
finish()
Block until the task is complete or this thread is interrupted. |
protected abstract void |
finish(long timeout,
TimeUnit unit)
Block until the task is complete, this thread is interrupted, or the given timeout is reached. |
ListenerSet.Sink |
finishListeners()
Access the ListenerSet responding to the completion of computation. |
protected TaskController.RunningState |
runningState()
Produce a running state. |
protected abstract void |
update()
Check the current status and call the appropriate method if the task is complete. |
| Methods inherited from class edu.rice.cs.plt.concurrent.TaskController |
|---|
attemptGet, attemptGet, cancel, cancel, discard, doStart, doStop, finishedCleanly, finishedWithImplementationException, finishedWithTaskException, get, get, get, hasValue, isCanceled, isCancelled, isDone, isResolved, start, started, status, stopped, value |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected PollingTaskController()
| Method Detail |
|---|
public ListenerSet.Sink finishListeners()
finishListeners in class TaskController<R>protected abstract void update()
protected abstract void finish()
throws InterruptedException
InterruptedException
protected abstract void finish(long timeout,
TimeUnit unit)
throws InterruptedException,
TimeoutException
InterruptedException
TimeoutExceptionprotected TaskController.RunningState runningState()
TaskController
runningState in class TaskController<R>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||