public class SingleSessionIoHandlerAdapter extends java.lang.Object implements SingleSessionIoHandler
SingleSessionIoHandler
interface. The session to which the handler is assigned is accessible
through the getSession() method.| Constructor and Description |
|---|
SingleSessionIoHandlerAdapter(IoSession session)
Creates a new instance that is assigned to the passed in session.
|
| Modifier and Type | Method and Description |
|---|---|
void |
exceptionCaught(java.lang.Throwable th)
Invoked when any exception is thrown by user
IoHandler
implementation or by MINA. |
protected IoSession |
getSession()
Retrieves the session to which this handler is assigned.
|
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.
|
public SingleSessionIoHandlerAdapter(IoSession session)
session - the session to which the handler is assignedprotected IoSession getSession()
public void exceptionCaught(java.lang.Throwable th)
throws java.lang.Exception
SingleSessionIoHandlerIoHandler
implementation or by MINA. If cause is instanceof
IOException, MINA will close the connection automatically.exceptionCaught in interface SingleSessionIoHandlerth - the caught exceptionjava.lang.ExceptionIoHandler.exceptionCaught(IoSession, Throwable)public void messageReceived(java.lang.Object message)
throws java.lang.Exception
SingleSessionIoHandlermessageReceived in interface SingleSessionIoHandlermessage - the received messagejava.lang.ExceptionIoHandler.messageReceived(IoSession, Object)public void messageSent(java.lang.Object message)
throws java.lang.Exception
SingleSessionIoHandlerIoSession.write(Object) is sent out actually.messageSent in interface SingleSessionIoHandlermessage - the sent messagejava.lang.ExceptionIoHandler.messageSent(IoSession, Object)public void sessionClosed()
throws java.lang.Exception
SingleSessionIoHandlersessionClosed in interface SingleSessionIoHandlerjava.lang.ExceptionIoHandler.sessionClosed(IoSession)public void sessionCreated()
throws java.lang.Exception
SingleSessionIoHandlersessionCreated in interface SingleSessionIoHandlerjava.lang.ExceptionIoHandler.sessionCreated(IoSession)public void sessionIdle(IdleStatus status) throws java.lang.Exception
SingleSessionIoHandlerIdleStatus. This
method is not invoked if the transport type is UDP.sessionIdle in interface SingleSessionIoHandlerstatus - the type of idlenessjava.lang.ExceptionIoHandler.sessionIdle(IoSession, IdleStatus)public void sessionOpened()
throws java.lang.Exception
SingleSessionIoHandlersessionOpened in interface SingleSessionIoHandlerjava.lang.ExceptionIoHandler.sessionOpened(IoSession)