@Deprecated public class SingleSessionIoHandlerDelegate extends Object implements IoHandler
IoHandler
implementation which delegates all requests to
SingleSessionIoHandler
s. A SingleSessionIoHandlerFactory
is used to create a new SingleSessionIoHandler
for each newly
created session.
WARNING : This IoHandler
implementation may be easier to understand and
thus to use but the user should be aware that creating one handler by session
will lower scalability if building an high performance server. This should only
be used with very specific needs in mind.Modifier and Type | Field and Description |
---|---|
static AttributeKey |
HANDLER
Deprecated.
The key used to store the
SingleSessionIoHandler as a session
attribute. |
Constructor and Description |
---|
SingleSessionIoHandlerDelegate(SingleSessionIoHandlerFactory factory)
Deprecated.
Creates a new instance that uses the passed in
SingleSessionIoHandlerFactory to create new
SingleSessionIoHandler s. |
Modifier and Type | Method and Description |
---|---|
void |
event(IoSession session,
FilterEvent event)
Deprecated.
Delegates the method call to the
SingleSessionIoHandler.event(FilterEvent) method of the handler
assigned to this session. |
void |
exceptionCaught(IoSession session,
Throwable cause)
Deprecated.
Delegates the method call to the
SingleSessionIoHandler.exceptionCaught(Throwable) method of the
handler assigned to this session. |
SingleSessionIoHandlerFactory |
getFactory()
Deprecated.
|
void |
inputClosed(IoSession session)
Deprecated.
Handle the closure of an half-duplex TCP channel
|
void |
messageReceived(IoSession session,
Object message)
Deprecated.
Delegates the method call to the
SingleSessionIoHandler.messageReceived(Object) method of the
handler assigned to this session. |
void |
messageSent(IoSession session,
Object message)
Deprecated.
Delegates the method call to the
SingleSessionIoHandler.messageSent(Object) method of the handler
assigned to this session. |
void |
sessionClosed(IoSession session)
Deprecated.
Delegates the method call to the
SingleSessionIoHandler.sessionClosed() method of the handler
assigned to this session. |
void |
sessionCreated(IoSession session)
Deprecated.
Creates a new instance with the factory passed to the constructor of
this class.
|
void |
sessionIdle(IoSession session,
IdleStatus status)
Deprecated.
Delegates the method call to the
SingleSessionIoHandler.sessionIdle(IdleStatus) method of the
handler assigned to this session. |
void |
sessionOpened(IoSession session)
Deprecated.
Delegates the method call to the
SingleSessionIoHandler.sessionOpened() method of the handler
assigned to this session. |
public static final AttributeKey HANDLER
SingleSessionIoHandler
as a session
attribute.public SingleSessionIoHandlerDelegate(SingleSessionIoHandlerFactory factory)
SingleSessionIoHandlerFactory
to create new
SingleSessionIoHandler
s.factory
- the factory for SingleSessionIoHandler
spublic SingleSessionIoHandlerFactory getFactory()
SingleSessionIoHandlerFactory
that is used to create a new
SingleSessionIoHandler
instance.public void sessionCreated(IoSession session) throws Exception
HANDLER
.sessionCreated
in interface IoHandler
session
- The session being createdException
- If we get an exception while processing the create eventIoHandler.sessionCreated(org.apache.mina.core.session.IoSession)
public void sessionOpened(IoSession session) throws Exception
SingleSessionIoHandler.sessionOpened()
method of the handler
assigned to this session.
Invoked when a connection has been opened. This method is invoked after
IoHandler.sessionCreated(IoSession)
. The biggest difference from
IoHandler.sessionCreated(IoSession)
is that it's invoked from other thread
than an I/O processor thread once thread model is configured properly.sessionOpened
in interface IoHandler
session
- The session being openedException
- If we get an exception while processing the open eventpublic void sessionClosed(IoSession session) throws Exception
SingleSessionIoHandler.sessionClosed()
method of the handler
assigned to this session.
Invoked when a connection is closed.sessionClosed
in interface IoHandler
session
- The session being closedException
- If we get an exception while processing the close eventpublic void sessionIdle(IoSession session, IdleStatus status) throws Exception
SingleSessionIoHandler.sessionIdle(IdleStatus)
method of the
handler assigned to this session.
Invoked with the related IdleStatus
when a connection becomes idle.
This method is not invoked if the transport type is UDP; it's a known bug,
and will be fixed in 2.0.sessionIdle
in interface IoHandler
session
- The idling sessionstatus
- The session's statusException
- If we get an exception while processing the idle eventpublic void exceptionCaught(IoSession session, Throwable cause) throws Exception
SingleSessionIoHandler.exceptionCaught(Throwable)
method of the
handler assigned to this session.
Invoked when any exception is thrown by user IoHandler
implementation or by MINA. If cause
is an instance of
IOException
, MINA will close the connection automatically.exceptionCaught
in interface IoHandler
session
- The session for which we have got an exceptioncause
- The exception that has been caughtException
- If we get an exception while processing the caught exceptionpublic void messageReceived(IoSession session, Object message) throws Exception
SingleSessionIoHandler.messageReceived(Object)
method of the
handler assigned to this session.
Invoked when a message is received.messageReceived
in interface IoHandler
session
- The session that is receiving a messagemessage
- The received messageException
- If we get an exception while processing the received messagepublic void messageSent(IoSession session, Object message) throws Exception
SingleSessionIoHandler.messageSent(Object)
method of the handler
assigned to this session.
Invoked when a message written by IoSession.write(Object)
is
sent out.messageSent
in interface IoHandler
session
- The session that has sent a full messagemessage
- The sent messageException
- If we get an exception while processing the sent messagepublic void inputClosed(IoSession session) throws Exception
inputClosed
in interface IoHandler
session
- The session which input is being closedException
- If we get an exception while closing the inputpublic void event(IoSession session, FilterEvent event) throws Exception
SingleSessionIoHandler.event(FilterEvent)
method of the handler
assigned to this session.
Invoked when a filter event is fired. Each filter might sent a different event,
this is very application specific.Copyright © 2004–2018 Apache MINA Project. All rights reserved.