Rice Pastry API

rice
Interface Continuation<R,E extends java.lang.Exception>

All Known Implementing Classes:
Continuation.ErrorContinuation, Continuation.ExternalContinuation, Continuation.ListenerContinuation, Continuation.NamedContinuation, Continuation.SimpleContinuation, Continuation.StandardContinuation, ContinuationMessage, FetchHandleMessage, FetchMessage, GCInsertMessage, GCLookupHandlesMessage, GCRefreshMessage, InsertMessage, LookupHandlesMessage, LookupMessage, MyMsg, PastRegrTest.TestCommand, PastRegrTest.TestExceptionCommand, RawPastRegrTest.TestCommand, RawPastRegrTest.TestExceptionCommand, ReplicationManagerImpl.ReplicationManagerDeleter

public interface Continuation<R,E extends java.lang.Exception>

Asynchronously receives the result to a given method call, using the command pattern. Implementations of this class contain the remainder of a computation which included an asynchronous method call. When the result to the call becomes available, the receiveResult method on this command is called.

Version:
$Id: Continuation.java 4654 2009-01-08 16:33:07Z jeffh $
Author:
Alan Mislove, Andreas Haeberlen

Nested Class Summary
static class Continuation.ErrorContinuation<R,E extends java.lang.Exception>
          This class is a Continuation provided for simplicity which passes any results up to the parent Continuation which it is constructed with.
static class Continuation.ExternalContinuation<R,E extends java.lang.Exception>
          This class provides a continuation which is designed to be used from an external thread.
static class Continuation.ExternalContinuationRunnable<R,E extends java.lang.Exception>
          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.
static class Continuation.ExternalRunnable
          This class is used when you want to run some task on the selector thread and wait for it to return its result.
static class Continuation.ListenerContinuation<R,E extends java.lang.Exception>
          This class is a Continuation provided for simplicity which listens for any errors and ignores any success values.
static class Continuation.MultiContinuation
          This class represents a Continuation which is used when multiple results are expected, which can come back at different times.
static class Continuation.NamedContinuation
          Continuation class which takes a provided string as it's name, and returns that String when toString() is called.
static class Continuation.SimpleContinuation
          This class is a Continuation provided for simplicity which passes both results and exceptions to the receiveResult() method.
static class Continuation.StandardContinuation<R,E extends java.lang.Exception>
          This class is a Continuation provided for simplicity which passes any errors up to the parent Continuation which it is constructed with.
 
Method Summary
 void receiveException(E exception)
          Called when an exception occurred as a result of the previous command.
 void receiveResult(R result)
          Called when a previously requested result is now available.
 

Method Detail

receiveResult

void receiveResult(R result)
Called when a previously requested result is now available.

Parameters:
result - The result of the command.

receiveException

void receiveException(E exception)
Called when an exception occurred as a result of the previous command.

Parameters:
result - The exception which was caused.

Rice Pastry API

Copyright © 2001-2005 - Rice Pastry.


Imprint-Dataprotection