org.apache.mina.handler.multiton
Class SingleSessionIoHandlerAdapter
java.lang.Object
org.apache.mina.handler.multiton.SingleSessionIoHandlerAdapter
- SingleSessionIoHandler
public class SingleSessionIoHandlerAdapter
extends java.lang.Object
SingleSessionIoHandlerAdapter
public SingleSessionIoHandlerAdapter(IoSession session)
Creates a new instance that is assigned to the passed in session.
session
- the session to which the handler is assigned
exceptionCaught
public void exceptionCaught(Throwable th)
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.
- exceptionCaught in interface SingleSessionIoHandler
getSession
protected IoSession getSession()
Retrieves the session to which this handler is assigned.
messageReceived
public void messageReceived(Object message)
throws Exception
Invoked when protocol message is received. Implement your protocol flow
here.
- messageReceived in interface SingleSessionIoHandler
message
- the received message
sessionClosed
public void sessionClosed()
throws Exception
Invoked when the connection is closed. This method is not invoked if the
transport type is UDP.
- sessionClosed in interface SingleSessionIoHandler
sessionCreated
public void sessionCreated()
throws Exception
Invoked when the session is created. Initialize default socket parameters
and user-defined attributes here.
- sessionCreated in interface SingleSessionIoHandler
sessionOpened
public void sessionOpened()
throws Exception
Invoked when the connection is opened. This method is not invoked if the
transport type is UDP.
- sessionOpened in interface SingleSessionIoHandler