Package org.apache.mina.handler.multiton
Class SingleSessionIoHandlerDelegate
java.lang.Object
org.apache.mina.handler.multiton.SingleSessionIoHandlerDelegate
- All Implemented Interfaces:
IoHandler
An
IoHandler
implementation which delegates all requests to
SingleSessionIoHandler
s. A SingleSessionIoHandlerFactory
is used to create a new SingleSessionIoHandler
for each newly
created session.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The key used to store theSingleSessionIoHandler
as a session attribute. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance that uses the passed inSingleSessionIoHandlerFactory
to create newSingleSessionIoHandler
s. -
Method Summary
Modifier and TypeMethodDescriptionvoid
exceptionCaught
(IoSession session, Throwable cause) Delegates the method call to theSingleSessionIoHandler.exceptionCaught(Throwable)
method of the handler assigned to this session.void
messageReceived
(IoSession session, Object message) Delegates the method call to theSingleSessionIoHandler.messageReceived(Object)
method of the handler assigned to this session.void
messageSent
(IoSession session, Object message) Delegates the method call to theSingleSessionIoHandler.messageSent(Object)
method of the handler assigned to this session.void
sessionClosed
(IoSession session) Delegates the method call to theSingleSessionIoHandler.sessionClosed()
method of the handler assigned to this session.void
sessionCreated
(IoSession session) Creates a new instance with the factory passed to the constructor of this class.void
sessionIdle
(IoSession session, IdleStatus status) Delegates the method call to theSingleSessionIoHandler.sessionIdle(IdleStatus)
method of the handler assigned to this session.void
sessionOpened
(IoSession session) Delegates the method call to theSingleSessionIoHandler.sessionOpened()
method of the handler assigned to this session.
-
Field Details
-
HANDLER
The key used to store theSingleSessionIoHandler
as a session attribute.
-
-
Constructor Details
-
SingleSessionIoHandlerDelegate
Creates a new instance that uses the passed inSingleSessionIoHandlerFactory
to create newSingleSessionIoHandler
s.- Parameters:
factory
- the factory forSingleSessionIoHandler
s
-
-
Method Details
-
sessionCreated
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:
sessionCreated
in interfaceIoHandler
- Throws:
Exception
- See Also:
-
sessionOpened
Delegates the method call to theSingleSessionIoHandler.sessionOpened()
method of the handler assigned to this session.- Specified by:
sessionOpened
in interfaceIoHandler
- Throws:
Exception
-
sessionClosed
Delegates the method call to theSingleSessionIoHandler.sessionClosed()
method of the handler assigned to this session.- Specified by:
sessionClosed
in interfaceIoHandler
- Throws:
Exception
-
sessionIdle
Delegates the method call to theSingleSessionIoHandler.sessionIdle(IdleStatus)
method of the handler assigned to this session.- Specified by:
sessionIdle
in interfaceIoHandler
- Throws:
Exception
-
exceptionCaught
Delegates the method call to theSingleSessionIoHandler.exceptionCaught(Throwable)
method of the handler assigned to this session.- Specified by:
exceptionCaught
in interfaceIoHandler
- Throws:
Exception
-
messageReceived
Delegates the method call to theSingleSessionIoHandler.messageReceived(Object)
method of the handler assigned to this session.- Specified by:
messageReceived
in interfaceIoHandler
- Throws:
Exception
-
messageSent
Delegates the method call to theSingleSessionIoHandler.messageSent(Object)
method of the handler assigned to this session.- Specified by:
messageSent
in interfaceIoHandler
- Throws:
Exception
-