rice.pastry.messaging
Class JavaSerializedDeserializer
java.lang.Object
rice.pastry.messaging.JavaSerializedDeserializer
- All Implemented Interfaces:
- MessageDeserializer
- Direct Known Subclasses:
- PJavaSerializedDeserializer
public class JavaSerializedDeserializer
- extends java.lang.Object
- implements MessageDeserializer
Handles "old" java serialized messages for programming convienience
and reverse compatability.
- Author:
- Jeff Hoye
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
pn
protected PastryNode pn
JavaSerializedDeserializer
public JavaSerializedDeserializer(PastryNode pn)
setAlwaysUseJavaSerialization
public void setAlwaysUseJavaSerialization(boolean val)
deserialize
public Message deserialize(InputBuffer buf,
short type,
int priority,
NodeHandle sender)
throws java.io.IOException
- Description copied from interface:
MessageDeserializer
- Typical implementation:
RawMessage ret = super.deserialize();
if (ret != null) return ret;
Endpoint endpoint;
switch(type) {
case 1:
return new MyMessage(buf, endpoint);
}
- Specified by:
deserialize
in interface MessageDeserializer
- Parameters:
buf
- accessor to the bytestype
- the message type, defined in RawMessage.getType()priority
- the priority of the messagesender
- the sender of the Message (may be null if not specified).
- Returns:
- The deserialized message.
- Throws:
java.io.IOException
Copyright © 2001-2005 - Rice Pastry.