public class Cache<K,V> extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
Cache.Factory<K,V>
Factory interface for creating various cacheable objects.
|
| Constructor and Description |
|---|
Cache(Cache.Factory<K,V> factory)
Constructs this cache using the specified
Factory. |
| Modifier and Type | Method and Description |
|---|---|
V |
get(K key)
If a value isn't associated with the specified key, a new
Callable will be created
wrapping the Factory specified via the constructor and passed to a
FutureTask. |
V |
remove(K key) |
public Cache(Cache.Factory<K,V> factory)
Factory.factory - public V get(K key)
Callable will be created
wrapping the Factory specified via the constructor and passed to a
FutureTask. This task will be passed to the backing ConcurrentMap. When
FutureTask.get() is invoked, the Factory will return the new Value which will be cached
by the FutureTask.key - the key the value is associated withCopyright © 2010–2022 JBoss by Red Hat. All rights reserved.