org.apache.mina.core.session

## Class ExpiringSessionRecycler

- java.lang.Object
- - org.apache.mina.core.session.ExpiringSessionRecycler

- All Implemented Interfaces:
    IoSessionRecycler

      public class ExpiringSessionRecycler
      extends Object
      implements IoSessionRecycler

  An `IoSessionRecycler` with sessions that time out on inactivity. TODO Document me.
  Author:
    Apache MINA Project

- - ### Field Summary

    - ### Fields inherited from interface org.apache.mina.core.session.IoSessionRecycler

      `NOOP`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ExpiringSessionRecycler()`
    `ExpiringSessionRecycler(int timeToLive)`
    `ExpiringSessionRecycler(int timeToLive, int expirationInterval)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getExpirationInterval()`
    `int` | `getTimeToLive()`
    `void` | `put(IoSession session)` Called when the underlying transport creates or writes a new `IoSession`.
    `IoSession` | `recycle(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 remoteAddress)

      Description copied from interface: `IoSessionRecycler`
      Attempts to retrieve a recycled `IoSession`.
      Specified by:
        `recycle` in interface `IoSessionRecycler`
      Parameters:
        `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)

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