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
deserialize
Message deserialize(InputBuffer buf,
short type,
int priority,
NodeHandle sender)
throws 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:
IOException
Copyright © 2010. All Rights Reserved.