org.apache.mina.util

## Class ExpiringMap.Expirer

- java.lang.Object
- - org.apache.mina.util.ExpiringMap.Expirer

- All Implemented Interfaces:
    Runnable
  Enclosing class:
    ExpiringMap<K,V>

      public class ExpiringMap.Expirer
      extends Object
      implements Runnable

  A Thread that monitors an `ExpiringMap` and will remove elements that have passed the threshold.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ExpiringMap.Expirer()` Creates a new instance of Expirer.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getExpirationInterval()` Get the interval in which an object will live in the map before it is removed.
    `int` | `getTimeToLive()` Returns the Time-to-live value.
    `boolean` | `isRunning()` Checks to see if the thread is running
    `void` | `run()`
    `void` | `setExpirationInterval(long expirationInterval)` Set the interval in which an object will live in the map before it is removed.
    `void` | `setTimeToLive(long timeToLive)` Update the value for the time-to-live
    `void` | `startExpiring()` Kick off this thread which will look for old objects and remove them.
    `void` | `startExpiringIfNotStarted()` If this thread has not started, then start it.
    `void` | `stopExpiring()` Stop the thread from monitoring the map.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ExpiringMap.Expirer

          public ExpiringMap.Expirer()

      Creates a new instance of Expirer.

  - ### Method Detail

    - #### run

          public void run()

      Specified by:
        `run` in interface `Runnable`

    - #### startExpiring

          public void startExpiring()

      Kick off this thread which will look for old objects and remove them.

    - #### startExpiringIfNotStarted

          public void startExpiringIfNotStarted()

      If this thread has not started, then start it. Otherwise just return;

    - #### stopExpiring

          public void stopExpiring()

      Stop the thread from monitoring the map.

    - #### isRunning

          public boolean isRunning()

      Checks to see if the thread is running
      Returns:
        If the thread is running, true. Otherwise false.

    - #### getTimeToLive

          public int getTimeToLive()

      Returns the Time-to-live value.
      Returns:
        The time-to-live (seconds)

    - #### setTimeToLive

          public void setTimeToLive(long timeToLive)

      Update the value for the time-to-live
      Parameters:
        `timeToLive` - The time-to-live (seconds)

    - #### getExpirationInterval

          public int getExpirationInterval()

      Get the interval in which an object will live in the map before it is removed.
      Returns:
        The time in seconds.

    - #### setExpirationInterval

          public void setExpirationInterval(long expirationInterval)

      Set the interval in which an object will live in the map before it is removed.
      Parameters:
        `expirationInterval` - The time in seconds

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