Class TimeLimited

java.lang.Object
org.castor.cache.AbstractBaseCache
org.castor.cache.simple.TimeLimited
All Implemented Interfaces:
Map<Object,Object>, Cache

public class TimeLimited extends AbstractBaseCache
TimeLimited is a time limted first-in-first-out Map. Every object being put in the Map will live until the timeout expired.

The expiration time is passed to the cache at initialization by the individual cache property ttl which defines the timeout of every object in the cache in seconds. If not specified a timeout of 30 seconds will be used.

Version:
$Revision: 8102 $ $Date: 2006-04-25 16:09:10 -0600 (Tue, 25 Apr 2006) $
Author:
Thomas Yip, Stein M. Hugubakken, Werner Guttmann, Ralf Joachim
  • Field Details

  • Constructor Details

    • TimeLimited

      public TimeLimited()
  • Method Details

    • initialize

      public final void initialize(Properties params) throws CacheAcquireException
      Lyfe-cycle method to allow custom initialization of cache implementations.
      Specified by:
      initialize in interface Cache
      Overrides:
      initialize in class AbstractBaseCache
      Parameters:
      params - Parameters to initialize the cache (e.g. name, capacity).
      Throws:
      CacheAcquireException - If cache can not be initialized.
    • getType

      public final String getType()
      Indicates the type of this cache.
      Returns:
      The cache type.
    • getTTL

      public final int getTTL()
      Get real ttl of this cache.
      Returns:
      Real ttl of this cache.
    • size

      public final int size()
    • isEmpty

      public final boolean isEmpty()
    • containsKey

      public final boolean containsKey(Object key)
    • containsValue

      public final boolean containsValue(Object value)
    • get

      public final Object get(Object key)
    • put

      public final Object put(Object key, Object value)
    • remove

      public Object remove(Object key)
    • putAll

      public final void putAll(Map<? extends Object,? extends Object> map)
    • clear

      public final void clear()
    • keySet

      public final Set<Object> keySet()
    • values

      public final Collection<Object> values()
    • entrySet

      public final Set<Map.Entry<Object,Object>> entrySet()