java.lang.Object
com.sun.faces.util.ConcurrentCache<K,V>
com.sun.faces.util.ExpiringConcurrentCache<K,V>
This class implements an abstract ConcurrentCache with objects in the cache potentially expiring. Only non-expired
objects will be returned from the cache or considered to be contained in the cache The cache is self-managing, so no
remove() method is defined
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Interface for checking whether a cached object expiredNested classes/interfaces inherited from class com.sun.faces.util.ConcurrentCache
ConcurrentCache.Factory<K,
V> -
Constructor Summary
ConstructorDescriptionExpiringConcurrentCache
(ConcurrentCache.Factory<K, V> f, ExpiringConcurrentCache.ExpiryChecker<K, V> checker) Public constructor. -
Method Summary
Modifier and TypeMethodDescriptionboolean
containsKey
(K key) Tests whether the cache contains a value for the specified keyRetrieves a value for the specified key.Methods inherited from class com.sun.faces.util.ConcurrentCache
getFactory
-
Constructor Details
-
ExpiringConcurrentCache
public ExpiringConcurrentCache(ConcurrentCache.Factory<K, V> f, ExpiringConcurrentCache.ExpiryChecker<K, V> checker) Public constructor.- Parameters:
f
- used to create new instances of objects that are not already availablechecker
- used to check whether an object in the cache has expired
-
-
Method Details
-
get
Description copied from class:ConcurrentCache
Retrieves a value for the specified key. If the value is not already present in the cache, a new instance will be allocated using theFactory
interface- Specified by:
get
in classConcurrentCache<K,
V> - Parameters:
key
- the key the value is associated with- Returns:
- the value for the specified key
- Throws:
ExecutionException
-
containsKey
Description copied from class:ConcurrentCache
Tests whether the cache contains a value for the specified key- Specified by:
containsKey
in classConcurrentCache<K,
V> - Parameters:
key
- key to test- Returns:
- true if the value for the specified key is already cached, false otherwise
-