public interface SingleSessionIoHandler
IoSession parameter for simplicity.
A SingleSessionIoHandler is similar to an IoHandler with
the notable difference that a SingleSessionIoHandler is used only
by one session at a time. Thus, there is no IoSession parameter in
the methods of this interface.
Because events are passed to the session in order, it is possible to store conversational state as instance variables in this object.
| 限定符和类型 | 方法和说明 |
|---|---|
void |
exceptionCaught(java.lang.Throwable cause)
Invoked when any exception is thrown by user
IoHandler
implementation or by MINA. |
void |
messageReceived(java.lang.Object message)
Invoked when protocol message is received.
|
void |
messageSent(java.lang.Object message)
Invoked when protocol message that user requested by
IoSession.write(Object) is sent out actually. |
void |
sessionClosed()
Invoked when the connection is closed.
|
void |
sessionCreated()
Invoked when the session is created.
|
void |
sessionIdle(IdleStatus status)
Invoked when the connection is idle.
|
void |
sessionOpened()
Invoked when the connection is opened.
|
void sessionCreated()
throws java.lang.Exception
java.lang.ExceptionIoHandler.sessionCreated(IoSession)void sessionOpened()
throws java.lang.Exception
java.lang.ExceptionIoHandler.sessionOpened(IoSession)void sessionClosed()
throws java.lang.Exception
java.lang.ExceptionIoHandler.sessionClosed(IoSession)void sessionIdle(IdleStatus status) throws java.lang.Exception
IdleStatus. This
method is not invoked if the transport type is UDP.status - the type of idlenessjava.lang.ExceptionIoHandler.sessionIdle(IoSession, IdleStatus)void exceptionCaught(java.lang.Throwable cause)
throws java.lang.Exception
IoHandler
implementation or by MINA. If cause is instanceof
IOException, MINA will close the connection automatically.cause - the caught exceptionjava.lang.ExceptionIoHandler.exceptionCaught(IoSession, Throwable)void messageReceived(java.lang.Object message)
throws java.lang.Exception
message - the received messagejava.lang.ExceptionIoHandler.messageReceived(IoSession, Object)void messageSent(java.lang.Object message)
throws java.lang.Exception
IoSession.write(Object) is sent out actually.message - the sent messagejava.lang.ExceptionIoHandler.messageSent(IoSession, Object)