|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object rice.pastry.messaging.MessageDispatch
public class MessageDispatch
An object which remembers the mapping from names to MessageReceivers and dispatches messages by request. For consistent routing, modified to only deliver messages to applications if the PastryNode.isReady(). It will still deliver messages to any non-PastryAppl because these "services" may be needed to boot the node into the ring. Any messages to a PastryAppl will be buffered until the node goes ready. TODO: We need to make it explicit which apps can receive messages before PastryNode.isReady().
Field Summary | |
---|---|
protected Deserializer |
deserializer
Also held by the transport layer to allow it to deserialize the messages. |
protected PastryNode |
localNode
|
protected Logger |
logger
|
Constructor Summary | |
---|---|
MessageDispatch(PastryNode pn,
Deserializer deserializer)
Constructor. |
Method Summary | |
---|---|
void |
destroy()
|
boolean |
dispatchMessage(Message msg)
Dispatches a message to the appropriate receiver. |
PastryAppl |
getDestination(Message msg)
|
PastryAppl |
getDestinationByAddress(int addr)
|
void |
registerReceiver(int address,
PastryAppl receiver)
Registers a receiver with the mail service. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected PastryNode localNode
protected Logger logger
protected Deserializer deserializer
Constructor Detail |
---|
public MessageDispatch(PastryNode pn, Deserializer deserializer)
Method Detail |
---|
public void registerReceiver(int address, PastryAppl receiver)
name
- a name for a receiver.receiver
- the receiver.public PastryAppl getDestination(Message msg)
public PastryAppl getDestinationByAddress(int addr)
public boolean dispatchMessage(Message msg)
msg
- the message.
public void destroy()
destroy
in interface Destructable
|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |