Interface MessageHandler<M>

Type Parameters:
M - The message type

public interface MessageHandler<M>
A handler interface that DemuxingIoHandler forwards messageReceived or messageSent events to. You have to register your handler with the type of the message you want to get notified using DemuxingIoHandler.addReceivedMessageHandler(Class, MessageHandler) or DemuxingIoHandler.addSentMessageHandler(Class, MessageHandler).
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final MessageHandler<Object>
    A MessageHandler that does nothing.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    handleMessage(IoSession session, M message)
    Invoked when the specific type of message is received from or sent to the specified session.
  • Field Details

  • Method Details

    • handleMessage

      void handleMessage(IoSession session, M message) throws Exception
      Invoked when the specific type of message is received from or sent to the specified session.
      Parameters:
      session - the associated IoSession
      message - the message to decode. Its type is set by the implementation
      Throws:
      Exception - if there is an error during the message processing