public enum StateMachine extends Enum<StateMachine>
当前枚举的各状态机事件在发生后都会及时触发Message.stateEvent(AioSession, StateMachine, Throwable)方法 因此用户在实现的Message接口中可对自己关心的状态机事件进行处理
| Enum Constant and Description |
|---|
DECODE_EXCEPTION
协议解码异常
执行
Protocol.decode(ByteBuffer, AioSession)期间发生未捕获的异常 |
INPUT_EXCEPTION
读操作异常
在底层服务执行read操作期间因发生异常情况出发了
CompletionHandler.failed(Throwable, Object)
未来该状态机可能会废除,并转移至NetMonitor |
INPUT_SHUTDOWN
读通道已被关闭
通常由以下几种情况会触发该状态:
对端主动关闭write通道,致使本通常满足了EOF条件
当前AioSession处理完读操作后检测到自身正处于
SESSION_CLOSING状态
未来该状态机可能会废除,并转移至NetMonitor |
NEW_SESSION
连接已建立并构建Session对象
|
OUTPUT_EXCEPTION
写操作异常
在底层服务执行write操作期间因发生异常情况出发了
CompletionHandler.failed(Throwable, Object)
未来该状态机可能会废除,并转移至NetMonitor |
PROCESS_EXCEPTION
业务处理异常
执行
Message.process(AioSession, Object)期间发生用户未捕获的异常 |
REJECT_ACCEPT
拒绝接受连接,仅Server端有效
|
SESSION_CLOSED
会话关闭成功
AioSession关闭成功
|
SESSION_CLOSING
会话正在关闭中
执行了
AioSession.close(boolean)方法,并且当前还存在待输出的数据 |
| Modifier and Type | Method and Description |
|---|---|
static StateMachine |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static StateMachine[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final StateMachine NEW_SESSION
public static final StateMachine INPUT_SHUTDOWN
SESSION_CLOSING状态public static final StateMachine PROCESS_EXCEPTION
Message.process(AioSession, Object)期间发生用户未捕获的异常public static final StateMachine DECODE_EXCEPTION
Protocol.decode(ByteBuffer, AioSession)期间发生未捕获的异常public static final StateMachine INPUT_EXCEPTION
CompletionHandler.failed(Throwable, Object)
未来该状态机可能会废除,并转移至NetMonitorpublic static final StateMachine OUTPUT_EXCEPTION
CompletionHandler.failed(Throwable, Object)
未来该状态机可能会废除,并转移至NetMonitorpublic static final StateMachine SESSION_CLOSING
AioSession.close(boolean)方法,并且当前还存在待输出的数据public static final StateMachine SESSION_CLOSED
public static final StateMachine REJECT_ACCEPT
public static StateMachine[] values()
for (StateMachine c : StateMachine.values()) System.out.println(c);
public static StateMachine valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullCopyright © 2019. All rights reserved.