Package org.castor.cache.simple
Class TimeLimited
java.lang.Object
org.castor.cache.AbstractBaseCache
org.castor.cache.simple.TimeLimited
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
-
Nested Class Summary
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDefault ttl of cache.static final StringMapped initialization parameterttl.static final StringThe type of the cache.Fields inherited from interface org.castor.cache.Cache
DEFAULT_DEBUG, DEFAULT_NAME, DEFAULT_TYPE, PARAM_DEBUG, PARAM_NAME, PARAM_TYPE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidclear()final booleancontainsKey(Object key) final booleancontainsValue(Object value) entrySet()final Objectfinal intgetTTL()Get real ttl of this cache.final StringgetType()Indicates the type of this cache.final voidinitialize(Properties params) Lyfe-cycle method to allow custom initialization of cache implementations.final booleanisEmpty()keySet()final Objectfinal voidfinal intsize()final Collection<Object> values()Methods inherited from class org.castor.cache.AbstractBaseCache
close, expire, expireAll, getName, invokeMethod, invokeStaticMethodMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Field Details
-
TYPE
The type of the cache.- See Also:
-
PARAM_TTL
Mapped initialization parameterttl.- See Also:
-
DEFAULT_TTL
public static final int DEFAULT_TTLDefault ttl of cache.- See Also:
-
-
Constructor Details
-
TimeLimited
public TimeLimited()
-
-
Method Details
-
initialize
Lyfe-cycle method to allow custom initialization of cache implementations.- Specified by:
initializein interfaceCache- Overrides:
initializein classAbstractBaseCache- Parameters:
params- Parameters to initialize the cache (e.g. name, capacity).- Throws:
CacheAcquireException- If cache can not be initialized.
-
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
-
containsValue
-
get
-
put
-
remove
-
putAll
-
clear
public final void clear() -
keySet
-
values
-
entrySet
-