Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.mina.handler.multiton
Class SingleSessionIoHandlerAdapter

    java.lang.Object
      org.apache.mina.handler.multiton.SingleSessionIoHandlerAdapter

All Implemented Interfaces:
  SingleSessionIoHandler

    public class SingleSessionIoHandlerAdapter

extends Object
implements SingleSessionIoHandler

Adapter class for implementors of the `SingleSessionIoHandler` interface. The session to which the handler is assigned is accessible through the `getSession()` method.

Version:
  $Rev: 555855 $, $Date: 2007-07-13 12:19:00 +0900 (Fri, 13 Jul 2007) $
Author:
  The Apache Directory Project (mina-dev@directory.apache.org)

Constructor Summary
`SingleSessionIoHandlerAdapter(IoSession session)` Creates a new instance that is assigned to the passed in session.

Method Summary
`void` | `exceptionCaught(Throwable th)` Invoked when any exception is thrown by user `IoHandler` implementation or by MINA.
`protected IoSession` | `getSession()` Retrieves the session to which this handler is assigned.
`void` | `messageReceived(Object message)` Invoked when protocol message is received.
`void` | `messageSent(Object message)` Invoked when protocol message that user requested by `IoSession.write(Object)` is sent out actually.
`void` | `sessionClosed()` Invoked when the connection is closed.
`void` | `sessionCreated()` Invoked when the session is created.
`void` | `sessionIdle(IdleStatus status)` Invoked when the connection is idle.
`void` | `sessionOpened()` Invoked when the connection is opened.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### SingleSessionIoHandlerAdapter

    public SingleSessionIoHandlerAdapter(IoSession session)

  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()

  Retrieves the session to which this handler is assigned.

  Returns:
    the session

### exceptionCaught

    public void exceptionCaught(Throwable th)
                         throws Exception

  Description copied from interface: `SingleSessionIoHandler`
  Invoked when any exception is thrown by user `IoHandler` implementation or by MINA. If `cause` is instanceof `IOException`, MINA will close the connection automatically.

  Specified by:
    `exceptionCaught` in interface `SingleSessionIoHandler`
  Parameters:
    `th` - the caught exception
  Throws:
    `Exception`
  See Also:
    `IoHandler.exceptionCaught(IoSession, Throwable)`

### messageReceived

    public void messageReceived(Object message)
                         throws Exception

  Description copied from interface: `SingleSessionIoHandler`
  Invoked when protocol message is received. Implement your protocol flow here.

  Specified by:
    `messageReceived` in interface `SingleSessionIoHandler`
  Parameters:
    `message` - the received message
  Throws:
    `Exception`
  See Also:
    `IoHandler.messageReceived(IoSession, Object)`

### messageSent

    public void messageSent(Object message)
                     throws Exception

  Description copied from interface: `SingleSessionIoHandler`
  Invoked when protocol message that user requested by `IoSession.write(Object)` is sent out actually.

  Specified by:
    `messageSent` in interface `SingleSessionIoHandler`
  Parameters:
    `message` - the sent message
  Throws:
    `Exception`
  See Also:
    `IoHandler.messageSent(IoSession, Object)`

### sessionClosed

    public void sessionClosed()
                       throws Exception

  Description copied from interface: `SingleSessionIoHandler`
  Invoked when the connection is closed. This method is not invoked if the transport type is UDP.

  Specified by:
    `sessionClosed` in interface `SingleSessionIoHandler`
  Throws:
    `Exception`
  See Also:
    `IoHandler.sessionClosed(IoSession)`

### sessionCreated

    public void sessionCreated()
                        throws Exception

  Description copied from interface: `SingleSessionIoHandler`
  Invoked when the session is created. Initialize default socket parameters and user-defined attributes here.

  Specified by:
    `sessionCreated` in interface `SingleSessionIoHandler`
  Throws:
    `Exception`
  See Also:
    `IoHandler.sessionCreated(IoSession)`

### sessionIdle

    public void sessionIdle(IdleStatus status)
                     throws Exception

  Description copied from interface: `SingleSessionIoHandler`
  Invoked when the connection is idle. Refer to `IdleStatus`. This method is not invoked if the transport type is UDP.

  Specified by:
    `sessionIdle` in interface `SingleSessionIoHandler`
  Parameters:
    `status` - the type of idleness
  Throws:
    `Exception`
  See Also:
    `IoHandler.sessionIdle(IoSession, IdleStatus)`

### sessionOpened

    public void sessionOpened()
                       throws Exception

  Description copied from interface: `SingleSessionIoHandler`
  Invoked when the connection is opened. This method is not invoked if the transport type is UDP.

  Specified by:
    `sessionOpened` in interface `SingleSessionIoHandler`
  Throws:
    `Exception`
  See Also:
    `IoHandler.sessionOpened(IoSession)`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004-2008 Apache MINA Project. All Rights Reserved.