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.
  • Constructor Details

    • ExpiringSessionRecycler

      public ExpiringSessionRecycler()
    • ExpiringSessionRecycler

      public ExpiringSessionRecycler(int timeToLive)
    • ExpiringSessionRecycler

      public ExpiringSessionRecycler(int timeToLive, int expirationInterval)
  • Method Details

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