java.lang.Object
org.miaixz.bus.socket.metric.handler.AbstractMessageHandler<T>
抽象消息处理
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidfinal void监控触发本次读回调Session的已读数据字节数final voidafterWrite(Session session, int writeSize) 监控触发本次写回调session的已写数据字节数final voidbeforeRead(Session session) 即将开始读取数据final voidbeforeWrite(Session session) 即将开始写数据final void处理接收到的消息abstract void处理接收到的消息shouldAccept(AsynchronousSocketChannel channel) 监控已接收到的连接final voidstateEvent(Session session, Status status, Throwable throwable) 状态机事件,当枚举事件发生时由框架触发该方法abstract voidstateEvent0(Session session, Status status, Throwable throwable)
-
Constructor Details
-
AbstractMessageHandler
public AbstractMessageHandler()
-
-
Method Details
-
afterRead
Description copied from interface:Monitor监控触发本次读回调Session的已读数据字节数 -
afterWrite
Description copied from interface:Monitor监控触发本次写回调session的已写数据字节数- Specified by:
afterWritein interfaceMonitor- Parameters:
session- 本次执行write回调的Session对象writeSize- 本次输出的数据长度
-
beforeRead
Description copied from interface:Monitor即将开始读取数据- Specified by:
beforeReadin interfaceMonitor- Parameters:
session- 当前会话对象
-
beforeWrite
Description copied from interface:Monitor即将开始写数据- Specified by:
beforeWritein interfaceMonitor- Parameters:
session- 当前会话对象
-
shouldAccept
Description copied from interface:Monitor监控已接收到的连接- Specified by:
shouldAcceptin interfaceMonitor- Parameters:
channel- 当前已经建立连接的通道对象- Returns:
- 非null:接受该连接,null:拒绝该连接
-
process
Description copied from interface:Handler处理接收到的消息 -
process0
处理接收到的消息- Parameters:
session- 会话data- 消息信息- See Also:
-
stateEvent
Description copied from interface:Handler状态机事件,当枚举事件发生时由框架触发该方法- Specified by:
stateEventin interfaceHandler<T>- Parameters:
session- 本次触发状态机的Session对象status- 状态枚举throwable- 异常对象,如果存在的话
-
stateEvent0
- Parameters:
session- 会话status- 状态throwable- 异常- See Also:
-
addPlugin
-