org.apache.mina.handler.multiton
Interface SingleSessionIoHandler
- SingleSessionIoHandlerAdapter
public interface SingleSessionIoHandler
A session handler without an
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.
exceptionCaught
public void exceptionCaught(Throwable cause)
throws Exception Invoked when any exception is thrown by user
IoHandler
implementation or by MINA. If
cause is instanceof
IOException, MINA will close the connection automatically.
cause - the caught exception
messageReceived
public void messageReceived(Object message)
throws Exception Invoked when protocol message is received. Implement your protocol flow
here.
message - the received message
messageSent
public void messageSent(Object message)
throws Exceptionmessage - the sent message
sessionClosed
public void sessionClosed()
throws Exception Invoked when the connection is closed. This method is not invoked if the
transport type is UDP.
sessionCreated
public void sessionCreated()
throws Exception Invoked when the session is created. Initialize default socket parameters
and user-defined attributes here.
sessionIdle
public void sessionIdle(IdleStatus status)
throws Exception Invoked when the connection is idle. Refer to
IdleStatus. This
method is not invoked if the transport type is UDP.
status - the type of idleness
sessionOpened
public void sessionOpened()
throws Exception Invoked when the connection is opened. This method is not invoked if the
transport type is UDP.