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.
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
Modifier and TypeMethodDescriptionvoidonClearCache(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 Details
-
onExpire
An entry is expired from the cache.- Parameters:
context- the listener contextkey- the entry keyobj- the entry value- Throws:
Exception- any exception
-
onRemove
An entry is removed from the cache.- Parameters:
context- the listener contextkey- the entry keyobj- the entry value- Throws:
Exception- any exception
-
onPut
An entry is inserted in the cache.- Parameters:
context- the listener contextkey- the entry keyobj- the entry value- Throws:
Exception- any exception
-
onPutLocal
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
An entry is retrieved from the cache.- Parameters:
context- the listener contextkey- the entry keyobj- the entry value- Throws:
Exception- any exception
-
onClearCache
The cache is globally cleared.- Parameters:
context- the listener context- Throws:
Exception- any exception
-