public abstract class AbstractPlugin<T> extends Object implements Plugin<T>
| Constructor and Description |
|---|
AbstractPlugin() |
| 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.
|
AsynchronousSocketChannel |
shouldAccept(AsynchronousSocketChannel channel)
监控已接收到的连接
|
void |
stateEvent(SocketStatus socketStatus,
AioSession session,
Throwable throwable)
监听状态机事件
|
public boolean preProcess(AioSession session, T t)
PluginpreProcess in interface Plugin<T>session - 会话t - 对象public void stateEvent(SocketStatus socketStatus, AioSession session, Throwable throwable)
PluginstateEvent in interface Plugin<T>socketStatus - 状态session - 会话throwable - 线程MessageProcessor.stateEvent(AioSession, SocketStatus, Throwable)public AsynchronousSocketChannel shouldAccept(AsynchronousSocketChannel channel)
NetMonitorshouldAccept in interface NetMonitorchannel - 当前已经建立连接的通道对象public void afterRead(AioSession session, int readSize)
NetMonitorafterRead in interface NetMonitorsession - 当前执行read的AioSession对象readSize - 已读数据长度public void afterWrite(AioSession session, int writeSize)
NetMonitorafterWrite in interface NetMonitorsession - 本次执行write回调的AIOSession对象writeSize - 本次输出的数据长度public void beforeRead(AioSession session)
NetMonitorbeforeRead in interface NetMonitorsession - 当前会话对象public void beforeWrite(AioSession session)
NetMonitorbeforeWrite in interface NetMonitorsession - 当前会话对象Copyright © 2021. All rights reserved.