dk.i1.diameter.node
Interface MessageDispatcher

All Known Implementing Classes:
NodeManager, SessionManager, SimpleSyncClient

public interface MessageDispatcher

A incoming message dispatcher. A MessageDispatcher is used by the Node class to dispatch incoming messages. Low-level house-keeping Diameter messages (CEx/DPx/DWx) are not dispatched to it but instead handled by the Node directly.

Please note that the handle() method is called by the networking thread and messages from other peers cannot be received until the method returns. If the handle() method needs to do any lengthy processing then it should implement a message queue, put the message into the queue, and return.

Also note that CER/CEA, DWR/DWA and DPR/DPA messages are given to the dispatcher because the node handles them itself. STR/STA, ASR/ASA and other base message are given to the dispatcher.


Method Summary
 boolean handle(Message msg, ConnectionKey connkey, Peer peer)
          This method is called when the Node has received a message.
 

Method Detail

handle

boolean handle(Message msg,
               ConnectionKey connkey,
               Peer peer)
This method is called when the Node has received a message.

Parameters:
msg - The incoming message
connkey - The connection key
peer - The peer of the connection. This is not necessarily the host that originated the message (the message can have gone via proxies)
Returns:
True if the message was processed. False otherwise, in which case the Node will respond with a error to the peer (if the message was a request).