Interface MessageProcessor<T>

Type Parameters:
T - 消息对象实体类型
All Known Implementing Classes:
AbstractMessageProcessor, GroupMessageProcessor

public interface MessageProcessor<T>
消息处理器。

通过实现该接口,对完成解码的消息进行业务处理。

Since:
Java 17+
Author:
Kimi Liu
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    process(AioSession session, T msg)
    处理接收到的消息
    default void
    stateEvent(AioSession session, SocketStatus socketStatus, Throwable throwable)
    状态机事件,当枚举事件发生时由框架触发该方法
  • Method Details

    • process

      void process(AioSession session, T msg)
      处理接收到的消息
      Parameters:
      session - 通信会话
      msg - 待处理的业务消息
    • stateEvent

      default void stateEvent(AioSession session, SocketStatus socketStatus, Throwable throwable)
      状态机事件,当枚举事件发生时由框架触发该方法
      Parameters:
      session - 本次触发状态机的AioSession对象
      socketStatus - 状态枚举
      throwable - 异常对象,如果存在的话
      See Also: