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

java.lang.Object
  extended by rice.Continuation.ExternalContinuation<R,E>
All Implemented Interfaces:
Continuation<R,E>
Enclosing interface:
Continuation<R,E extends Exception>

public static class Continuation.ExternalContinuation<R,E extends Exception>
extends Object
implements Continuation<R,E>

This class provides a continuation which is designed to be used from an external thread. Applications should construct this continuation pass it in to the appropriate method, and then call sleep(). Once the thread is woken up, the user should check exceptionThrown() to determine if an error was caused, and then call getException() or getResult() as appropriate.


Nested Class Summary
 
Nested classes/interfaces inherited from interface rice.Continuation
Continuation.ErrorContinuation<R,E extends Exception>, Continuation.ExternalContinuation<R,E extends Exception>, Continuation.ExternalContinuationRunnable<R,E extends Exception>, Continuation.ExternalRunnable, Continuation.ListenerContinuation<R,E extends Exception>, Continuation.MultiContinuation, Continuation.NamedContinuation, Continuation.SimpleContinuation, Continuation.StandardContinuation<R,E extends Exception>
 
Field Summary
protected  boolean done
           
protected  Exception exception
           
protected  Object result
           
 
Constructor Summary
Continuation.ExternalContinuation()
           
 
Method Summary
 boolean exceptionThrown()
           
 Exception getException()
           
 Object getResult()
           
 void receiveException(Exception e)
          Called when an exception occurred as a result of the previous command.
 void receiveResult(Object o)
          Called when a previously requested result is now available.
 void sleep()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

exception

protected Exception exception

result

protected Object result

done

protected boolean done
Constructor Detail

Continuation.ExternalContinuation

public Continuation.ExternalContinuation()
Method Detail

receiveResult

public void receiveResult(Object o)
Description copied from interface: Continuation
Called when a previously requested result is now available.

Specified by:
receiveResult in interface Continuation<R,E extends Exception>
Parameters:
o - The result of the command.

receiveException

public void receiveException(Exception e)
Description copied from interface: Continuation
Called when an exception occurred as a result of the previous command.

Specified by:
receiveException in interface Continuation<R,E extends Exception>

getResult

public Object getResult()

getException

public Exception getException()

sleep

public void sleep()

exceptionThrown

public boolean exceptionThrown()


Copyright © 2010. All Rights Reserved.