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
Class ExpiringSessionRecycler

    java.lang.Object
      org.apache.mina.common.ExpiringSessionRecycler

All Implemented Interfaces:
  IoSessionRecycler

    public class ExpiringSessionRecycler

extends Object
implements IoSessionRecycler

An `IoSessionRecycler` with sessions that time out on inactivity. TODO Document me.

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

Fields inherited from interface org.apache.mina.common.IoSessionRecycler
`NOOP`

Constructor Summary
`ExpiringSessionRecycler()`
`ExpiringSessionRecycler(int timeToLive)`
`ExpiringSessionRecycler(int timeToLive, int expirationInterval)`

Method Summary
`int` | `getExpirationInterval()`
`int` | `getTimeToLive()`
`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.
`void` | `setExpirationInterval(int expirationInterval)`
`void` | `setTimeToLive(int timeToLive)`
`void` | `stopExpiring()`

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

Constructor Detail

### ExpiringSessionRecycler

    public ExpiringSessionRecycler()

### ExpiringSessionRecycler

    public ExpiringSessionRecycler(int timeToLive)

### ExpiringSessionRecycler

    public ExpiringSessionRecycler(int timeToLive,
                                   int expirationInterval)

Method Detail

### put

    public void put(IoSession session)

  Description copied from interface: `IoSessionRecycler`
  Called when the underlying transport creates or writes a new `IoSession`.

  Specified by:
    `put` in interface `IoSessionRecycler`
  Parameters:
    `session` - the new `IoSession`.

### recycle

    public IoSession recycle(SocketAddress localAddress,
                             SocketAddress remoteAddress)

  Description copied from interface: `IoSessionRecycler`
  Attempts to retrieve a recycled `IoSession`.

  Specified by:
    `recycle` in interface `IoSessionRecycler`
  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

    public void remove(IoSession session)

  Description copied from interface: `IoSessionRecycler`
  Called when an `IoSession` is explicitly closed.

  Specified by:
    `remove` in interface `IoSessionRecycler`
  Parameters:
    `session` - the new `IoSession`.

### stopExpiring

    public void stopExpiring()

### getExpirationInterval

    public int getExpirationInterval()

### getTimeToLive

    public int getTimeToLive()

### setExpirationInterval

    public void setExpirationInterval(int expirationInterval)

### setTimeToLive

    public void setTimeToLive(int timeToLive)

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.