org.elkoserver.foundation.json
Interface DefaultDispatchTarget

All Known Implementing Classes:
BasicObject, Context, Item, User

public interface DefaultDispatchTarget

Interface for an object to handle JSON messages addressed to it for which it does not otherwise have specific methods.

When the MessageDispatcher attempts to deliver a message to an object, it first looks for a JSONMethod attributed method corresponding to the specific message it is trying to deliver. If such a method is found, that method is invoked. However, if there is no such method, then the dispatcher checks whether the object implements this interface; if it does, then it invokes the handleMessage() method to handle it.


Method Summary
 void handleMessage(Deliverer from, JSONObject message)
          Handle a message for which the MessageDispatcher could not find an appropriate specific method to invoke.
 

Method Detail

handleMessage

void handleMessage(Deliverer from,
                   JSONObject message)
                   throws MessageHandlerException
Handle a message for which the MessageDispatcher could not find an appropriate specific method to invoke.

Parameters:
from - The sender of the message.
message - The message.
Throws:
MessageHandlerException - if there was some kind of problem handling the message.