@Deprecated
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.
WARNING: This class is badly named as the actualIoHandler
implementor
is in fact the SingleSessionIoHandlerDelegate
.限定符和类型 | 方法和说明 |
---|---|
void |
exceptionCaught(java.lang.Throwable cause)
已过时。
Invoked when any exception is thrown by user
IoHandler
implementation or by MINA. |
void |
inputClosed(IoSession session)
已过时。
Invoked when a half-duplex connection is closed
|
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.Exception
- If the session can't be createdIoHandler.sessionCreated(IoSession)
void sessionOpened() throws java.lang.Exception
java.lang.Exception
- If the session can't be openedIoHandler.sessionOpened(IoSession)
void sessionClosed() throws java.lang.Exception
java.lang.Exception
- If the session can't be closedIoHandler.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.Exception
- If the idle event can't be handledIoHandler.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.Exception
- If the exception can't be handledIoHandler.exceptionCaught(IoSession, Throwable)
void inputClosed(IoSession session)
session
- The current sessionvoid messageReceived(java.lang.Object message) throws java.lang.Exception
message
- the received messagejava.lang.Exception
- If the received message can't be processedIoHandler.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.Exception
- If the sent message can't be processedIoHandler.messageSent(IoSession, Object)