edu.rice.cs.plt.concurrent
Class PollingTaskController.PollingCancelingState

java.lang.Object
  extended by edu.rice.cs.plt.concurrent.TaskController.State
      extended by edu.rice.cs.plt.concurrent.TaskController.ComputingState
          extended by edu.rice.cs.plt.concurrent.TaskController.CancelingState
              extended by edu.rice.cs.plt.concurrent.PollingTaskController.PollingCancelingState
Enclosing class:
PollingTaskController<R>

protected class PollingTaskController.PollingCancelingState
extends TaskController.CancelingState

CancelingState variant based on a PollingRunner. Extends Canceling to allow it to be recognized as that type. (A lot of code is duplicated from PollingRunningState, but that seems inevitable without overhauling the design to use interfaces to identify different kinds of states.)


Constructor Summary
protected PollingTaskController.PollingCancelingState()
           
 
Method Summary
 boolean cancel(boolean stopRunning)
           
 R get()
           
 R get(long timeout, TimeUnit u)
           
 void start()
           
 TaskController.Status status()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PollingTaskController.PollingCancelingState

protected PollingTaskController.PollingCancelingState()
Method Detail

start

public void start()
Overrides:
start in class TaskController.CancelingState

status

public TaskController.Status status()
Overrides:
status in class TaskController.CancelingState

cancel

public boolean cancel(boolean stopRunning)
Overrides:
cancel in class TaskController.CancelingState

get

public R get()
      throws InterruptedException,
             ExecutionException
Overrides:
get in class TaskController.ComputingState
Throws:
InterruptedException
ExecutionException

get

public R get(long timeout,
             TimeUnit u)
      throws InterruptedException,
             ExecutionException,
             TimeoutException
Overrides:
get in class TaskController.ComputingState
Throws:
InterruptedException
ExecutionException
TimeoutException