Package org.exoplatform.services.cache
Interface CacheListener<K extends Serializable,V>
-
- All Known Implementing Classes:
InvalidationExoCache,LoggingCacheListener
public interface CacheListener<K extends Serializable,V>Created by The eXo Platform SAS
The cache listener allows to be aware of various events that occurs for a cache. For performance reason a listener must perform short time lived operations or should consider to perform jobs asynchronously.- Author:
- tuan08@users.sourceforge.net Tuan Nguyen
- eXo level API
- Platform
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidonClearCache(CacheListenerContext context)The cache is globally cleared.voidonExpire(CacheListenerContext context, K key, V obj)An entry is expired from the cache.voidonGet(CacheListenerContext context, K key, V obj)An entry is retrieved from the cache.voidonPut(CacheListenerContext context, K key, V obj)An entry is inserted in the cache.default voidonPutLocal(CacheListenerContext context, K key, V obj)An entry is inserted in the cache (local mode without replication).voidonRemove(CacheListenerContext context, K key, V obj)An entry is removed from the cache.
-
-
-
Method Detail
-
onExpire
void onExpire(CacheListenerContext context, K key, V obj) throws Exception
An entry is expired from the cache.- Parameters:
context- the listener contextkey- the entry keyobj- the entry value- Throws:
Exception- any exception
-
onRemove
void onRemove(CacheListenerContext context, K key, V obj) throws Exception
An entry is removed from the cache.- Parameters:
context- the listener contextkey- the entry keyobj- the entry value- Throws:
Exception- any exception
-
onPut
void onPut(CacheListenerContext context, K key, V obj) throws Exception
An entry is inserted in the cache.- Parameters:
context- the listener contextkey- the entry keyobj- the entry value- Throws:
Exception- any exception
-
onPutLocal
default void onPutLocal(CacheListenerContext context, K key, V obj) throws Exception
An entry is inserted in the cache (local mode without replication).- Parameters:
context- the listener contextkey- the entry keyobj- the entry value- Throws:
Exception- any exception
-
onGet
void onGet(CacheListenerContext context, K key, V obj) throws Exception
An entry is retrieved from the cache.- Parameters:
context- the listener contextkey- the entry keyobj- the entry value- Throws:
Exception- any exception
-
onClearCache
void onClearCache(CacheListenerContext context) throws Exception
The cache is globally cleared.- Parameters:
context- the listener context- Throws:
Exception- any exception
-
-