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 SingleSessionIoHandlerDelegate

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

All Implemented Interfaces:
  IoHandler

    public class SingleSessionIoHandlerDelegate

extends Object
implements 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.

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)

Field Summary
`static String` | `HANDLER` The key used to store the `SingleSessionIoHandler` as a session attribute.

Constructor Summary
`SingleSessionIoHandlerDelegate(SingleSessionIoHandlerFactory factory)` Creates a new instance that uses the passed in `SingleSessionIoHandlerFactory` to create new `SingleSessionIoHandler`s.

Method Summary
`void` | `exceptionCaught(IoSession session, Throwable cause)` Delegates the method call to the `SingleSessionIoHandler.exceptionCaught(Throwable)` method of the handler assigned to this session.
`void` | `messageReceived(IoSession session, Object message)` Delegates the method call to the `SingleSessionIoHandler.messageReceived(Object)` method of the handler assigned to this session.
`void` | `messageSent(IoSession session, 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.

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

Field Detail

### HANDLER

    public static final String HANDLER

  The key used to store the `SingleSessionIoHandler` as a session attribute.

Constructor Detail

### SingleSessionIoHandlerDelegate

    public SingleSessionIoHandlerDelegate(SingleSessionIoHandlerFactory factory)

  Creates a new instance that uses the passed in `SingleSessionIoHandlerFactory` to create new `SingleSessionIoHandler`s.

  Parameters:
    `factory` - the factory for `SingleSessionIoHandler`s

Method Detail

### sessionCreated

    public void sessionCreated(IoSession session)
                        throws Exception

  Creates a new instance with the factory passed to the constructor of this class. The created handler is stored as a session attribute named `HANDLER`.

  Specified by:
    `sessionCreated` in interface `IoHandler`
  Throws:
    `Exception`
  See Also:
    `IoHandler.sessionCreated(org.apache.mina.common.IoSession)`

### sessionOpened

    public void sessionOpened(IoSession session)
                       throws Exception

  Delegates the method call to the `SingleSessionIoHandler.sessionOpened()` method of the handler assigned to this session.

  Specified by:
    `sessionOpened` in interface `IoHandler`
  Throws:
    `Exception`

### sessionClosed

    public void sessionClosed(IoSession session)
                       throws Exception

  Delegates the method call to the `SingleSessionIoHandler.sessionClosed()` method of the handler assigned to this session.

  Specified by:
    `sessionClosed` in interface `IoHandler`
  Throws:
    `Exception`

### sessionIdle

    public void sessionIdle(IoSession session,
                            IdleStatus status)
                     throws Exception

  Delegates the method call to the `SingleSessionIoHandler.sessionIdle(IdleStatus)` method of the handler assigned to this session.

  Specified by:
    `sessionIdle` in interface `IoHandler`
  Throws:
    `Exception`

### exceptionCaught

    public void exceptionCaught(IoSession session,
                                Throwable cause)
                         throws Exception

  Delegates the method call to the `SingleSessionIoHandler.exceptionCaught(Throwable)` method of the handler assigned to this session.

  Specified by:
    `exceptionCaught` in interface `IoHandler`
  Throws:
    `Exception`

### messageReceived

    public void messageReceived(IoSession session,
                                Object message)
                         throws Exception

  Delegates the method call to the `SingleSessionIoHandler.messageReceived(Object)` method of the handler assigned to this session.

  Specified by:
    `messageReceived` in interface `IoHandler`
  Throws:
    `Exception`

### messageSent

    public void messageSent(IoSession session,
                            Object message)
                     throws Exception

  Delegates the method call to the `SingleSessionIoHandler.messageSent(Object)` method of the handler assigned to this session.

  Specified by:
    `messageSent` in interface `IoHandler`
  Throws:
    `Exception`

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.