Package org.apache.mina.handler.multiton
Class SingleSessionIoHandlerAdapter
- java.lang.Object
-
- org.apache.mina.handler.multiton.SingleSessionIoHandlerAdapter
-
- All Implemented Interfaces:
SingleSessionIoHandler
@Deprecated public class SingleSessionIoHandlerAdapter extends Object implements SingleSessionIoHandler
Deprecated.This class is deprecatedAdapter class for implementors of theSingleSessionIoHandler
interface. The session to which the handler is assigned is accessible through the getSession() method.- Author:
- Apache MINA Project
-
-
Constructor Summary
Constructors Constructor Description SingleSessionIoHandlerAdapter(IoSession session)
Deprecated.Creates a new instance that is assigned to the passed in session.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
exceptionCaught(Throwable th)
Deprecated.Invoked when any exception is thrown by userIoHandler
implementation or by MINA.protected IoSession
getSession()
Deprecated.Retrieves the session to which this handler is assigned.void
inputClosed(IoSession session)
Deprecated.Invoked when a half-duplex connection is closedvoid
messageReceived(Object message)
Deprecated.Invoked when protocol message is received.void
messageSent(Object message)
Deprecated.Invoked when protocol message that user requested byIoSession.write(Object)
is sent out actually.void
sessionClosed()
Deprecated.Invoked when the connection is closed.void
sessionCreated()
Deprecated.Invoked when the session is created.void
sessionIdle(IdleStatus status)
Deprecated.Invoked when the connection is idle.void
sessionOpened()
Deprecated.Invoked when the connection is opened.
-
-
-
Constructor Detail
-
SingleSessionIoHandlerAdapter
public SingleSessionIoHandlerAdapter(IoSession session)
Deprecated.Creates a new instance that is assigned to the passed in session.- Parameters:
session
- the session to which the handler is assigned
-
-
Method Detail
-
getSession
protected IoSession getSession()
Deprecated.Retrieves the session to which this handler is assigned.- Returns:
- the session
-
exceptionCaught
public void exceptionCaught(Throwable th) throws Exception
Deprecated.Invoked when any exception is thrown by userIoHandler
implementation or by MINA. Ifcause
is instanceofIOException
, MINA will close the connection automatically.- Specified by:
exceptionCaught
in interfaceSingleSessionIoHandler
- Parameters:
th
- the caught exception- Throws:
Exception
- If the exception can't be handled- See Also:
IoHandler.exceptionCaught(IoSession, Throwable)
-
inputClosed
public void inputClosed(IoSession session)
Deprecated.Invoked when a half-duplex connection is closed- Specified by:
inputClosed
in interfaceSingleSessionIoHandler
- Parameters:
session
- The current session
-
messageReceived
public void messageReceived(Object message) throws Exception
Deprecated.Invoked when protocol message is received. Implement your protocol flow here.- Specified by:
messageReceived
in interfaceSingleSessionIoHandler
- Parameters:
message
- the received message- Throws:
Exception
- If the received message can't be processed- See Also:
IoHandler.messageReceived(IoSession, Object)
-
messageSent
public void messageSent(Object message) throws Exception
Deprecated.Invoked when protocol message that user requested byIoSession.write(Object)
is sent out actually.- Specified by:
messageSent
in interfaceSingleSessionIoHandler
- Parameters:
message
- the sent message- Throws:
Exception
- If the sent message can't be processed- See Also:
IoHandler.messageSent(IoSession, Object)
-
sessionClosed
public void sessionClosed() throws Exception
Deprecated.Invoked when the connection is closed. This method is not invoked if the transport type is UDP.- Specified by:
sessionClosed
in interfaceSingleSessionIoHandler
- Throws:
Exception
- If the session can't be closed- See Also:
IoHandler.sessionClosed(IoSession)
-
sessionCreated
public void sessionCreated() throws Exception
Deprecated.Invoked when the session is created. Initialize default socket parameters and user-defined attributes here.- Specified by:
sessionCreated
in interfaceSingleSessionIoHandler
- Throws:
Exception
- If the session can't be created- See Also:
IoHandler.sessionCreated(IoSession)
-
sessionIdle
public void sessionIdle(IdleStatus status) throws Exception
Deprecated.Invoked when the connection is idle. Refer toIdleStatus
. This method is not invoked if the transport type is UDP.- Specified by:
sessionIdle
in interfaceSingleSessionIoHandler
- Parameters:
status
- the type of idleness- Throws:
Exception
- If the idle event can't be handled- See Also:
IoHandler.sessionIdle(IoSession, IdleStatus)
-
sessionOpened
public void sessionOpened() throws Exception
Deprecated.Invoked when the connection is opened. This method is not invoked if the transport type is UDP.- Specified by:
sessionOpened
in interfaceSingleSessionIoHandler
- Throws:
Exception
- If the session can't be opened- See Also:
IoHandler.sessionOpened(IoSession)
-
-