Rice Pastry API

rice.p2p.past.messaging
Class ContinuationMessage

java.lang.Object
  extended byrice.p2p.past.messaging.PastMessage
      extended byrice.p2p.past.messaging.ContinuationMessage
All Implemented Interfaces:
Continuation, Message, RawMessage, java.io.Serializable
Direct Known Subclasses:
FetchHandleMessage, FetchMessage, GCRefreshMessage, InsertMessage, LookupHandlesMessage, LookupMessage

public abstract class ContinuationMessage
extends PastMessage
implements Continuation

Version:
$Id: ContinuationMessage.java 3274 2006-05-15 16:17:47Z jeffh $
Author:
Alan Mislove, Ansley Post, Peter Druschel
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class rice.Continuation
Continuation.ErrorContinuation, Continuation.ExternalContinuation, Continuation.ExternalContinuationRunnable, Continuation.ExternalRunnable, Continuation.ListenerContinuation, Continuation.MultiContinuation, Continuation.NamedContinuation, Continuation.SimpleContinuation, Continuation.StandardContinuation
 
Field Summary
protected  java.lang.Exception exception
          DESCRIBE THE FIELD
protected  java.lang.Object response
          DESCRIBE THE FIELD
static byte S_EMPTY
          No response or exception.
static byte S_JAVA_EXCEPTION
          Java Serialized Exception
static byte S_JAVA_RESPONSE
          Java Serialized Response
static byte S_SUB
          Subclass handled serialization.
protected  byte serType
          DESCRIBE THE FIELD
 
Fields inherited from class rice.p2p.past.messaging.PastMessage
dest, id, isResponse, source
 
Fields inherited from interface rice.p2p.commonapi.Message
HIGH_PRIORITY, LOW_PRIORITY, MAX_PRIORITY, MEDIUM_HIGH_PRIORITY, MEDIUM_LOW_PRIORITY, MEDIUM_PRIORITY
 
Constructor Summary
  ContinuationMessage(InputBuffer buf, Endpoint endpoint)
          The serialization stategy is that usually the subtype will have an optimal serialization strategy, but sometimes we will have to revert to java serialization
protected ContinuationMessage(int uid, NodeHandle source, Id dest)
          Constructor which takes a unique integer Id, as well as the data to be stored
 
Method Summary
 void deserialize(InputBuffer buf, Endpoint endpoint)
           
 java.lang.Object getResponse()
          Returns the response
 void receiveException(java.lang.Exception e)
          Method which builds a response for this message, using the provided exception, which was thrown
 void receiveResult(java.lang.Object o)
          Method which builds a response for this message, using the provided object as a result.
 void returnResponse(Continuation c, Environment env, java.lang.String instance)
          Method by which this message is supposed to return it's response.
 void serialize(OutputBuffer buf)
          Deprecated. use serialize(OutputBuffer buf, boolean javaSerialize)
 void serialize(OutputBuffer buf, boolean javaSerialize)
          If you want this class to serialize itself, set javaSerialize to true, otherwise, the subclass is expected to do an optimal serializatoin
 
Methods inherited from class rice.p2p.past.messaging.PastMessage
addHop, getDestination, getPriority, getSource, getUID, isResponse, setResponse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface rice.p2p.commonapi.rawserialization.RawMessage
getType
 

Field Detail

response

protected java.lang.Object response
DESCRIBE THE FIELD


exception

protected java.lang.Exception exception
DESCRIBE THE FIELD


serType

protected byte serType
DESCRIBE THE FIELD


S_EMPTY

public static byte S_EMPTY
No response or exception.


S_SUB

public static byte S_SUB
Subclass handled serialization.


S_JAVA_RESPONSE

public static byte S_JAVA_RESPONSE
Java Serialized Response


S_JAVA_EXCEPTION

public static byte S_JAVA_EXCEPTION
Java Serialized Exception

Constructor Detail

ContinuationMessage

protected ContinuationMessage(int uid,
                              NodeHandle source,
                              Id dest)
Constructor which takes a unique integer Id, as well as the data to be stored

Parameters:
uid - The unique id
source - The source handle
dest - The destination address

ContinuationMessage

public ContinuationMessage(InputBuffer buf,
                           Endpoint endpoint)
                    throws java.io.IOException
The serialization stategy is that usually the subtype will have an optimal serialization strategy, but sometimes we will have to revert to java serialization

Parameters:
buf -
endpoint -
Throws:
java.io.IOException - DESCRIBE THE EXCEPTION
java.io.IOException
Method Detail

getResponse

public java.lang.Object getResponse()
Returns the response

Returns:
The response

receiveResult

public void receiveResult(java.lang.Object o)
Method which builds a response for this message, using the provided object as a result.

Specified by:
receiveResult in interface Continuation
Parameters:
o - The object argument

receiveException

public void receiveException(java.lang.Exception e)
Method which builds a response for this message, using the provided exception, which was thrown

Specified by:
receiveException in interface Continuation
Parameters:
e - The exception argument

returnResponse

public void returnResponse(Continuation c,
                           Environment env,
                           java.lang.String instance)
Method by which this message is supposed to return it's response.

Specified by:
returnResponse in class PastMessage
Parameters:
c - The continuation to return the reponse to.
env - DESCRIBE THE PARAMETER
instance - DESCRIBE THE PARAMETER

deserialize

public void deserialize(InputBuffer buf,
                        Endpoint endpoint)
                 throws java.io.IOException
Parameters:
buf -
endpoint - DESCRIBE THE PARAMETER
Throws:
java.io.IOException

serialize

public void serialize(OutputBuffer buf)
               throws java.io.IOException
Deprecated. use serialize(OutputBuffer buf, boolean javaSerialize)

Deprecated to cause warnings.

Specified by:
serialize in interface RawMessage
Overrides:
serialize in class PastMessage
Parameters:
buf - DESCRIBE THE PARAMETER
Throws:
java.io.IOException - DESCRIBE THE EXCEPTION

serialize

public void serialize(OutputBuffer buf,
                      boolean javaSerialize)
               throws java.io.IOException
If you want this class to serialize itself, set javaSerialize to true, otherwise, the subclass is expected to do an optimal serializatoin

Parameters:
buf -
javaSerialize -
Throws:
java.io.IOException

Rice Pastry API

Copyright © 2001-2005 - Rice Pastry.


Imprint-Dataprotection