rice
Class Continuation.ExternalContinuationRunnable<R,E extends Exception>

java.lang.Object
  extended by rice.Continuation.ExternalContinuationRunnable<R,E>
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
Continuation.ExternalRunnable
Enclosing interface:
Continuation<R,E extends Exception>

public abstract static class Continuation.ExternalContinuationRunnable<R,E extends Exception>
extends Object
implements Runnable

This class is used when you want to run some task on the selector thread and wait for it to return its result in a Continuation. It is essentially a convenience object which combines the functionality of a Runnable that can be invoked on the Selector with an ExternalContinuation that it will wait on. Override the run(Continuation) method then call invoke() to get the result or Exception from the operation. The current thread will block on invoke until the continuation returns a result or an exception.

Author:
jstewart

Constructor Summary
Continuation.ExternalContinuationRunnable()
           
 
Method Summary
protected abstract  void execute(Continuation c)
           
 Object invoke(Environment env)
           
 Object invoke(SelectorManager sm)
           
 void run()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Continuation.ExternalContinuationRunnable

public Continuation.ExternalContinuationRunnable()
Method Detail

run

public void run()
Specified by:
run in interface Runnable

execute

protected abstract void execute(Continuation c)
                         throws Exception
Throws:
Exception

invoke

public Object invoke(SelectorManager sm)
              throws Exception
Throws:
Exception

invoke

public Object invoke(Environment env)
              throws Exception
Throws:
Exception


Copyright © 2010. All Rights Reserved.