java.lang.Object
com.sun.faces.util.Cache<K,V>
A concurrent caching mechanism.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Factory interface for creating various cacheable objects. -
Constructor Summary
ConstructorDescriptionCache
(Cache.Factory<K, V> factory) Constructs this cache using the specifiedFactory
. -
Method Summary
-
Constructor Details
-
Cache
Constructs this cache using the specifiedFactory
.- Parameters:
factory
- a factory to create or retrieve the element that need to be cached
-
-
Method Details
-
get
If a value isn't associated with the specified key, a newCallable
will be created wrapping theFactory
specified via the constructor and passed to aFutureTask
. This task will be passed to the backing ConcurrentMap. WhenFutureTask.get()
is invoked, the Factory will return the new Value which will be cached by theFutureTask
.- Parameters:
key
- the key the value is associated with- Returns:
- the value for the specified key, if any
-
remove
-