public class SimpleReplicatedExoCache<K extends Serializable,V extends Serializable> extends ConcurrentFIFOExoCache<K,V>
This implementation of ExoCache will behave exactly the same way as ConcurrentFIFOExoCache
except in case of a cache change, indeed the modifications will be first applied locally
then it will be replicated over the cluster asynchronously to limit the performance impact
on the local cluster node.
This class can be used as a drop-in replacement for ConcurrentFIFOExoCache in a cluster environment
as long as we know that modifications like remove, clearCache, removeCachedObjects, put or putMap happen rarely.
In other words, it should be used for caches that rarely change.
| Constructor and Description |
|---|
SimpleReplicatedExoCache() |
| Modifier and Type | Method and Description |
|---|---|
void |
clearCache()
Clears the cache.
|
protected void |
finalize() |
void |
put(K name,
V obj)
Performs a put in the cache.
|
void |
putMap(Map<? extends K,? extends V> objs)
Performs a put of all the entries provided by the map argument.
|
V |
remove(Serializable name)
Removes an entry from the cache.
|
void |
setName(String s)
Sets the cache name.
|
addCacheListener, assertConsistent, get, getCachedObjects, getCacheHit, getCacheMiss, getCacheSize, getLabel, getLiveTime, getLiveTimeMillis, getMaxSize, getName, isLogEnabled, removeCachedObjects, select, setLabel, setLiveTime, setLiveTimeMillis, setLogEnabled, setMaxSizepublic void setName(String s)
ExoCachesetName in interface ExoCache<K extends Serializable,V extends Serializable>setName in class ConcurrentFIFOExoCache<K extends Serializable,V extends Serializable>s - the cache namepublic V remove(Serializable name)
ExoCacheremove in interface ExoCache<K extends Serializable,V extends Serializable>remove in class ConcurrentFIFOExoCache<K extends Serializable,V extends Serializable>name - the cache keypublic void clearCache()
ExoCacheclearCache in interface ExoCache<K extends Serializable,V extends Serializable>clearCache in class ConcurrentFIFOExoCache<K extends Serializable,V extends Serializable>public void put(K name, V obj)
ExoCacheput in interface ExoCache<K extends Serializable,V extends Serializable>put in class ConcurrentFIFOExoCache<K extends Serializable,V extends Serializable>name - the cache keyobj - the cached valuepublic void putMap(Map<? extends K,? extends V> objs)
ExoCacheputMap in interface ExoCache<K extends Serializable,V extends Serializable>putMap in class ConcurrentFIFOExoCache<K extends Serializable,V extends Serializable>objs - the objects to putCopyright © 2015 eXo Platform SAS. All Rights Reserved.