Package org.apache.mina.handler.multiton
Class SingleSessionIoHandlerAdapter
java.lang.Object
org.apache.mina.handler.multiton.SingleSessionIoHandlerAdapter
- All Implemented Interfaces:
SingleSessionIoHandler
Adapter class for implementors of the
SingleSessionIoHandler
interface. The session to which the handler is assigned is accessible
through the getSession() method.-
Constructor Summary
ConstructorsConstructorDescriptionSingleSessionIoHandlerAdapter(IoSession session) Creates a new instance that is assigned to the passed in session. -
Method Summary
Modifier and TypeMethodDescriptionvoidInvoked when any exception is thrown by userIoHandlerimplementation or by MINA.protected IoSessionRetrieves the session to which this handler is assigned.voidmessageReceived(Object message) Invoked when protocol message is received.voidmessageSent(Object message) Invoked when protocol message that user requested byIoSession.write(Object)is sent out actually.voidInvoked when the connection is closed.voidInvoked when the session is created.voidsessionIdle(IdleStatus status) Invoked when the connection is idle.voidInvoked when the connection is opened.
-
Constructor Details
-
SingleSessionIoHandlerAdapter
Creates a new instance that is assigned to the passed in session.- Parameters:
session- the session to which the handler is assigned
-
-
Method Details
-
getSession
Retrieves the session to which this handler is assigned.- Returns:
- the session
-
exceptionCaught
Description copied from interface:SingleSessionIoHandlerInvoked when any exception is thrown by userIoHandlerimplementation or by MINA. Ifcauseis instanceofIOException, MINA will close the connection automatically.- Specified by:
exceptionCaughtin interfaceSingleSessionIoHandler- Parameters:
th- the caught exception- Throws:
Exception- See Also:
-
messageReceived
Description copied from interface:SingleSessionIoHandlerInvoked when protocol message is received. Implement your protocol flow here.- Specified by:
messageReceivedin interfaceSingleSessionIoHandler- Parameters:
message- the received message- Throws:
Exception- See Also:
-
messageSent
Description copied from interface:SingleSessionIoHandlerInvoked when protocol message that user requested byIoSession.write(Object)is sent out actually.- Specified by:
messageSentin interfaceSingleSessionIoHandler- Parameters:
message- the sent message- Throws:
Exception- See Also:
-
sessionClosed
Description copied from interface:SingleSessionIoHandlerInvoked when the connection is closed. This method is not invoked if the transport type is UDP.- Specified by:
sessionClosedin interfaceSingleSessionIoHandler- Throws:
Exception- See Also:
-
sessionCreated
Description copied from interface:SingleSessionIoHandlerInvoked when the session is created. Initialize default socket parameters and user-defined attributes here.- Specified by:
sessionCreatedin interfaceSingleSessionIoHandler- Throws:
Exception- See Also:
-
sessionIdle
Description copied from interface:SingleSessionIoHandlerInvoked when the connection is idle. Refer toIdleStatus. This method is not invoked if the transport type is UDP.- Specified by:
sessionIdlein interfaceSingleSessionIoHandler- Parameters:
status- the type of idleness- Throws:
Exception- See Also:
-
sessionOpened
Description copied from interface:SingleSessionIoHandlerInvoked when the connection is opened. This method is not invoked if the transport type is UDP.- Specified by:
sessionOpenedin interfaceSingleSessionIoHandler- Throws:
Exception- See Also:
-