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.common
Interface IoSessionRecycler

All Known Implementing Classes:
  ExpiringSessionRecycler

    public interface IoSessionRecycler

A connectionless transport can recycle existing sessions by assigning an IoSessionRecyler to its `IoServiceConfig`.

Author:
  The Apache Directory Project (mina-dev@directory.apache.org) TODO More documentation

Field Summary
`static IoSessionRecycler` | `NOOP` A dummy recycler that doesn't recycle any sessions.

Method Summary
`void` | `put(IoSession session)` Called when the underlying transport creates or writes a new `IoSession`.
`IoSession` | `recycle(SocketAddress localAddress, SocketAddress remoteAddress)` Attempts to retrieve a recycled `IoSession`.
`void` | `remove(IoSession session)` Called when an `IoSession` is explicitly closed.

Field Detail

### NOOP

    static final IoSessionRecycler NOOP

  A dummy recycler that doesn't recycle any sessions. Using this recycler will make all session lifecycle events to be fired for every I/O for all connectionless sessions.

Method Detail

### put

    void put(IoSession session)

  Called when the underlying transport creates or writes a new `IoSession`.

  Parameters:
    `session` - the new `IoSession`.

### recycle

    IoSession recycle(SocketAddress localAddress,
                      SocketAddress remoteAddress)

  Attempts to retrieve a recycled `IoSession`.

  Parameters:
    `localAddress` - the local socket address of the `IoSession` the transport wants to recycle.
    `remoteAddress` - the remote socket address of the `IoSession` the transport wants to recycle.
  Returns:
    a recycled `IoSession`, or null if one cannot be found.

### remove

    void remove(IoSession session)

  Called when an `IoSession` is explicitly closed.

  Parameters:
    `session` - the new `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.