public class MonitorPlugin<T> extends AbstractPlugin<T> implements Runnable
| Constructor and Description |
|---|
MonitorPlugin() |
MonitorPlugin(int seconds) |
| Modifier and Type | Method and Description |
|---|---|
void |
afterRead(AioSession session,
int readSize)
监控触发本次读回调Session的已读数据字节数
|
void |
afterWrite(AioSession session,
int writeSize)
监控触发本次写回调session的已写数据字节数
|
void |
beforeRead(AioSession session)
即将开始读取数据
|
void |
beforeWrite(AioSession session)
即将开始写数据
|
boolean |
preProcess(AioSession session,
T t)
对请求消息进行预处理,并决策是否进行后续的MessageProcessor处理
若返回false,则当前消息将被忽略
若返回true,该消息会正常秩序MessageProcessor.process.
|
void |
run() |
void |
stateEvent(SocketStatus socketStatus,
AioSession session,
Throwable throwable)
监听状态机事件
|
shouldAcceptpublic MonitorPlugin()
public MonitorPlugin(int seconds)
public boolean preProcess(AioSession session, T t)
PluginpreProcess in interface Plugin<T>preProcess in class AbstractPlugin<T>session - 会话t - 对象public void stateEvent(SocketStatus socketStatus, AioSession session, Throwable throwable)
PluginstateEvent in interface Plugin<T>stateEvent in class AbstractPlugin<T>socketStatus - 状态session - 会话throwable - 线程MessageProcessor.stateEvent(AioSession, SocketStatus, Throwable)public void afterRead(AioSession session, int readSize)
NetMonitorafterRead in interface NetMonitorafterRead in class AbstractPlugin<T>session - 当前执行read的AioSession对象readSize - 已读数据长度public void beforeRead(AioSession session)
NetMonitorbeforeRead in interface NetMonitorbeforeRead in class AbstractPlugin<T>session - 当前会话对象public void afterWrite(AioSession session, int writeSize)
NetMonitorafterWrite in interface NetMonitorafterWrite in class AbstractPlugin<T>session - 本次执行write回调的AIOSession对象writeSize - 本次输出的数据长度public void beforeWrite(AioSession session)
NetMonitorbeforeWrite in interface NetMonitorbeforeWrite in class AbstractPlugin<T>session - 当前会话对象Copyright © 2021. All rights reserved.