Package com.sodius.oslc.core.cache
Class AbstractCache<K,V>
- java.lang.Object
-
- com.sodius.oslc.core.cache.AbstractCache<K,V>
-
- Type Parameters:
K
- the cache entry key type.V
- the cache entry value type.
- All Implemented Interfaces:
com.google.common.cache.Cache<K,V>
public abstract class AbstractCache<K,V> extends Object implements com.google.common.cache.Cache<K,V>
Almost ready-to-use genericCache
implementation.This class implements all the methods whose behavior or result can be derived from the not-implemented methods. Applications can extend this class to provide only the required (not-derivable) behavior; however, if the underlying implementation is better, in terms of performance, for a given derived method, they MUST override it and use the better performance implementation.
- Since:
- 3.3.0
-
-
Constructor Summary
Constructors Constructor Description AbstractCache()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description V
get(K key, Callable<? extends V> loader)
com.google.common.collect.ImmutableMap<K,V>
getAllPresent(Iterable<?> keys)
void
invalidate(Object key)
void
invalidateAll()
void
putAll(Map<? extends K,? extends V> m)
long
size()
com.google.common.cache.CacheStats
stats()
-
-
-
Method Detail
-
get
public V get(K key, Callable<? extends V> loader) throws ExecutionException
- Specified by:
get
in interfacecom.google.common.cache.Cache<K,V>
- Throws:
ExecutionException
-
invalidate
public void invalidate(Object key)
-
invalidateAll
public void invalidateAll()
-
-