@Deprecated public class SingleSessionIoHandlerDelegate extends java.lang.Object implements IoHandler
IoHandler implementation which delegates all requests to
SingleSessionIoHandlers. 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.| 限定符和类型 | 字段和说明 |
|---|---|
static AttributeKey |
HANDLER
已过时。
The key used to store the
SingleSessionIoHandler as a session
attribute. |
| 构造器和说明 |
|---|
SingleSessionIoHandlerDelegate(SingleSessionIoHandlerFactory factory)
已过时。
Creates a new instance that uses the passed in
SingleSessionIoHandlerFactory to create new
SingleSessionIoHandlers. |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
exceptionCaught(IoSession session,
java.lang.Throwable cause)
已过时。
Delegates the method call to the
SingleSessionIoHandler.exceptionCaught(Throwable) method of the
handler assigned to this session. |
SingleSessionIoHandlerFactory |
getFactory()
已过时。
|
void |
inputClosed(IoSession session)
已过时。
Handle the closure of an half-duplex TCP channel
|
void |
messageReceived(IoSession session,
java.lang.Object message)
已过时。
Delegates the method call to the
SingleSessionIoHandler.messageReceived(Object) method of the
handler assigned to this session. |
void |
messageSent(IoSession session,
java.lang.Object message)
已过时。
Delegates the method call to the
SingleSessionIoHandler.messageSent(Object) method of the handler
assigned to this session. |
void |
sessionClosed(IoSession session)
已过时。
Delegates the method call to the
SingleSessionIoHandler.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 the
SingleSessionIoHandler.sessionIdle(IdleStatus) method of the
handler assigned to this session. |
void |
sessionOpened(IoSession session)
已过时。
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
SingleSessionIoHandlers.factory - the factory for SingleSessionIoHandlerspublic SingleSessionIoHandlerFactory getFactory()
SingleSessionIoHandlerFactory that is used to create a new
SingleSessionIoHandler instance.public void sessionCreated(IoSession session) throws java.lang.Exception
HANDLER.sessionCreated 在接口中 IoHandlersession - The session being createdjava.lang.Exception - If we get an exception while processing the create event{@inheritDoc}public void sessionOpened(IoSession session) throws java.lang.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 在接口中 IoHandlersession - The session being openedjava.lang.Exception - If we get an exception while processing the open eventpublic void sessionClosed(IoSession session) throws java.lang.Exception
SingleSessionIoHandler.sessionClosed() method of the handler
assigned to this session.
Invoked when a connection is closed.sessionClosed 在接口中 IoHandlersession - The session being closedjava.lang.Exception - If we get an exception while processing the close eventpublic void sessionIdle(IoSession session, IdleStatus status) throws java.lang.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 在接口中 IoHandlersession - The idling sessionstatus - The session's statusjava.lang.Exception - If we get an exception while processing the idle eventpublic void exceptionCaught(IoSession session, java.lang.Throwable cause) throws java.lang.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 在接口中 IoHandlersession - The session for which we have got an exceptioncause - The exception that has been caughtjava.lang.Exception - If we get an exception while processing the caught exceptionpublic void messageReceived(IoSession session, java.lang.Object message) throws java.lang.Exception
SingleSessionIoHandler.messageReceived(Object) method of the
handler assigned to this session.
Invoked when a message is received.messageReceived 在接口中 IoHandlersession - The session that is receiving a messagemessage - The received messagejava.lang.Exception - If we get an exception while processing the received messagepublic void messageSent(IoSession session, java.lang.Object message) throws java.lang.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 在接口中 IoHandlersession - The session that has sent a full messagemessage - The sent messagejava.lang.Exception - If we get an exception while processing the sent messagepublic void inputClosed(IoSession session) throws java.lang.Exception
inputClosed 在接口中 IoHandlersession - The session which input is being closedjava.lang.Exception - If we get an exception while closing the input