Class AsyncInvalidationExoCache<K extends Serializable,V>
java.lang.Object
org.exoplatform.services.cache.concurrent.ConcurrentFIFOExoCache<K,V>
org.exoplatform.services.cache.invalidation.AsyncInvalidationExoCache<K,V>
- All Implemented Interfaces:
ExoCache<K,V>
public class AsyncInvalidationExoCache<K extends Serializable,V>
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 invalidated 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.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidon clear cache eventvoidOn expire entry eventvoidPerforms a put in the cache.voidPerforms a put in the cache local mode (avoid replication).voidPerforms a put of all the entries provided by the map argument.remove(Serializable key) Removes an entry from the cache.voidremoveLocal(Serializable key) Removes an entry from the cache local mode (avoid replication).Methods inherited from class org.exoplatform.services.cache.concurrent.ConcurrentFIFOExoCache
addCacheListener, assertConsistent, clearCache, get, getCachedObjects, getCacheHit, getCacheMiss, getCacheSize, getLabel, getLiveTime, getLiveTimeMillis, getMaxSize, getName, isLogEnabled, onGet, onPut, onPutLocal, onRemove, removeCachedObjects, select, setLabel, setLiveTime, setLiveTimeMillis, setLogEnabled, setMaxSize, setNameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.exoplatform.services.cache.ExoCache
putAsyncMap
-
Constructor Details
-
AsyncInvalidationExoCache
-
-
Method Details
-
put
Description copied from interface:ExoCachePerforms a put in the cache.- Specified by:
putin interfaceExoCache<K extends Serializable,V> - Overrides:
putin classConcurrentFIFOExoCache<K extends Serializable,V> - Parameters:
key- the cache keyvalue- the cached value- Throws:
NullPointerException- if the key is null
-
putLocal
Description copied from interface:ExoCachePerforms a put in the cache local mode (avoid replication).- Specified by:
putLocalin interfaceExoCache<K extends Serializable,V> - Overrides:
putLocalin classConcurrentFIFOExoCache<K extends Serializable,V> - Parameters:
key- the cache keyvalue- the cached value- Throws:
NullPointerException- if the key is null
-
remove
Description copied from interface:ExoCacheRemoves an entry from the cache.- Specified by:
removein interfaceExoCache<K extends Serializable,V> - Overrides:
removein classConcurrentFIFOExoCache<K extends Serializable,V> - Parameters:
key- the cache key- Returns:
- the previously cached value or null if no entry existed or that entry value was evaluated to null
- Throws:
NullPointerException- if the provided key is null
-
removeLocal
Description copied from interface:ExoCacheRemoves an entry from the cache local mode (avoid replication).- Parameters:
key- the cache key- Throws:
NullPointerException- if the provided key is null
-
putMap
public void putMap(Map<? extends K, ? extends V> objs) throws NullPointerException, IllegalArgumentExceptionDescription copied from interface:ExoCachePerforms a put of all the entries provided by the map argument.- Specified by:
putMapin interfaceExoCache<K extends Serializable,V> - Overrides:
putMapin classConcurrentFIFOExoCache<K extends Serializable,V> - Parameters:
objs- the objects to put- Throws:
NullPointerException- if the provided argument is nullIllegalArgumentException- if the provided map contains a null key
-
onExpire
Description copied from interface:ExoCacheOn expire entry event- Specified by:
onExpirein interfaceExoCache<K extends Serializable,V> - Overrides:
onExpirein classConcurrentFIFOExoCache<K extends Serializable,V> - Parameters:
key- entry keyobj- value
-
onClearCache
public void onClearCache()Description copied from interface:ExoCacheon clear cache event- Specified by:
onClearCachein interfaceExoCache<K extends Serializable,V> - Overrides:
onClearCachein classConcurrentFIFOExoCache<K extends Serializable,V>
-
getListeners
- Overrides:
getListenersin classConcurrentFIFOExoCache<K extends Serializable,V>
-