rice.p2p.commonapi.rawserialization
Interface MessageDeserializer
- All Known Implementing Classes:
- ConsistentJoinProtocol.CJPDeserializer, GCPastImpl.GCPastDeserializer, JavaSerializedDeserializer, JavaSerializedDeserializer, PastImpl.PastDeserializer, PeriodicLeafSetProtocol.PLSPMessageDeserializer, PJavaSerializedDeserializer, StandardJoinProtocol.SJPDeserializer
public interface MessageDeserializer
Because Pastry/Transport layer cannot know about all messge types, each app needs to
provide a deserializer. Default, there is a Java Serializer
Method Summary |
Message |
deserialize(InputBuffer buf,
short type,
int priority,
NodeHandle sender)
Typical implementation:
RawMessage ret = super.deserialize();
if (ret != null) return ret;
Endpoint endpoint;
switch(type) {
case 1:
return new MyMessage(buf, endpoint);
} |
deserialize
Message deserialize(InputBuffer buf,
short type,
int priority,
NodeHandle sender)
throws java.io.IOException
- Typical implementation:
RawMessage ret = super.deserialize();
if (ret != null) return ret;
Endpoint endpoint;
switch(type) {
case 1:
return new MyMessage(buf, endpoint);
}
- 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.