Package org.apache.mina.handler.multiton
Class SingleSessionIoHandlerDelegate
- java.lang.Object
-
- org.apache.mina.handler.multiton.SingleSessionIoHandlerDelegate
-
- All Implemented Interfaces:
IoHandler
public class SingleSessionIoHandlerDelegate extends java.lang.Object implements IoHandler
AnIoHandlerimplementation which delegates all requests toSingleSessionIoHandlers. ASingleSessionIoHandlerFactoryis used to create a newSingleSessionIoHandlerfor each newly created session.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringHANDLERThe key used to store theSingleSessionIoHandleras a session attribute.
-
Constructor Summary
Constructors Constructor Description SingleSessionIoHandlerDelegate(SingleSessionIoHandlerFactory factory)Creates a new instance that uses the passed inSingleSessionIoHandlerFactoryto create newSingleSessionIoHandlers.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexceptionCaught(IoSession session, java.lang.Throwable cause)Delegates the method call to theSingleSessionIoHandler.exceptionCaught(Throwable)method of the handler assigned to this session.voidmessageReceived(IoSession session, java.lang.Object message)Delegates the method call to theSingleSessionIoHandler.messageReceived(Object)method of the handler assigned to this session.voidmessageSent(IoSession session, java.lang.Object message)Delegates the method call to theSingleSessionIoHandler.messageSent(Object)method of the handler assigned to this session.voidsessionClosed(IoSession session)Delegates the method call to theSingleSessionIoHandler.sessionClosed()method of the handler assigned to this session.voidsessionCreated(IoSession session)Creates a new instance with the factory passed to the constructor of this class.voidsessionIdle(IoSession session, IdleStatus status)Delegates the method call to theSingleSessionIoHandler.sessionIdle(IdleStatus)method of the handler assigned to this session.voidsessionOpened(IoSession session)Delegates the method call to theSingleSessionIoHandler.sessionOpened()method of the handler assigned to this session.
-
-
-
Field Detail
-
HANDLER
public static final java.lang.String HANDLER
The key used to store theSingleSessionIoHandleras a session attribute.
-
-
Constructor Detail
-
SingleSessionIoHandlerDelegate
public SingleSessionIoHandlerDelegate(SingleSessionIoHandlerFactory factory)
Creates a new instance that uses the passed inSingleSessionIoHandlerFactoryto create newSingleSessionIoHandlers.- Parameters:
factory- the factory forSingleSessionIoHandlers
-
-
Method Detail
-
sessionCreated
public void sessionCreated(IoSession session) throws java.lang.Exception
Creates a new instance with the factory passed to the constructor of this class. The created handler is stored as a session attribute namedHANDLER.- Specified by:
sessionCreatedin interfaceIoHandler- Throws:
java.lang.Exception- See Also:
IoHandler.sessionCreated(org.apache.mina.common.IoSession)
-
sessionOpened
public void sessionOpened(IoSession session) throws java.lang.Exception
Delegates the method call to theSingleSessionIoHandler.sessionOpened()method of the handler assigned to this session.- Specified by:
sessionOpenedin interfaceIoHandler- Throws:
java.lang.Exception
-
sessionClosed
public void sessionClosed(IoSession session) throws java.lang.Exception
Delegates the method call to theSingleSessionIoHandler.sessionClosed()method of the handler assigned to this session.- Specified by:
sessionClosedin interfaceIoHandler- Throws:
java.lang.Exception
-
sessionIdle
public void sessionIdle(IoSession session, IdleStatus status) throws java.lang.Exception
Delegates the method call to theSingleSessionIoHandler.sessionIdle(IdleStatus)method of the handler assigned to this session.- Specified by:
sessionIdlein interfaceIoHandler- Throws:
java.lang.Exception
-
exceptionCaught
public void exceptionCaught(IoSession session, java.lang.Throwable cause) throws java.lang.Exception
Delegates the method call to theSingleSessionIoHandler.exceptionCaught(Throwable)method of the handler assigned to this session.- Specified by:
exceptionCaughtin interfaceIoHandler- Throws:
java.lang.Exception
-
messageReceived
public void messageReceived(IoSession session, java.lang.Object message) throws java.lang.Exception
Delegates the method call to theSingleSessionIoHandler.messageReceived(Object)method of the handler assigned to this session.- Specified by:
messageReceivedin interfaceIoHandler- Throws:
java.lang.Exception
-
messageSent
public void messageSent(IoSession session, java.lang.Object message) throws java.lang.Exception
Delegates the method call to theSingleSessionIoHandler.messageSent(Object)method of the handler assigned to this session.- Specified by:
messageSentin interfaceIoHandler- Throws:
java.lang.Exception
-
-