Interface MessageHandler

All Known Implementing Classes:
AbstractMessageHandler

public interface MessageHandler
Interface for a client which wishes to receive messages. In most cases it is more convenient to subclass the abstract class AbstractMessageHandler than to implement this interface directly.
Since:
16 Jul 2008
Author:
Mark Taylor
  • Method Details

    • getSubscriptions

      Map getSubscriptions()
      Returns a Subscriptions map corresponding to the messages handled by this object. Only messages with MTypes which match the keys of this map will be passed to this object.
      Returns:
      Subscriptions-like map
    • receiveNotification

      void receiveNotification(HubConnection connection, String senderId, Message message) throws Exception
      Processes a message which does not require a response.
      Parameters:
      connection - hub connection
      senderId - public ID of client which sent the message
      message - message
      Throws:
      Exception
    • receiveCall

      void receiveCall(HubConnection connection, String senderId, String msgId, Message message) throws Exception
      Processes a message which does require a response. Implementations should make sure that a subsequent call to connection.reply() is made using the supplied msgId.
      Parameters:
      connection - hub connection
      senderId - public ID of client which sent the message
      msgId - message ID
      message - message
      Throws:
      Exception