K
- type of the key to identify a cached value. It should be an
immutable type. It is critical this type implements equals() and
hashCode() correctly.V
- type of the cached value.public class CacheModelProxy<K,V> extends Object implements Cache<K,V>
There is no need to call Cache.put(Object, Object)
in
CacheModelProxy because the cache will be automatically updated by the
model when an object that doesn't belong to the cache is requested. If
Cache.get(Object)
in CacheModelProxy returns null
it means
the object does not belong to the cache nor the model.
Modifier and Type | Class and Description |
---|---|
static interface |
CacheModelProxy.Model<K,V>
Model.
|
Constructor and Description |
---|
CacheModelProxy(Cache<K,V> cache,
CacheModelProxy.Model<K,V> model)
Creates a new
Cache . |
public void put(K key, V value)
Cache
public void invalidate(K key)
Cache
invalidate
in interface Cache<K,V>
key
- key to invalidate.Copyright © 2015. All Rights Reserved.