-
public interface CacheEventListenerAn interface for logging various cache events.
In all callback methods, the CacheEvent object should not be held beyond the method itself as they may be automatically recycled.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enumCacheEventListener.EvictionReason
-
Method Summary
Modifier and Type Method Description abstract voidonHit(CacheEvent cacheEvent)Triggered by a cache hit. abstract voidonMiss(CacheEvent cacheEvent)Triggered by a cache miss for the given key. abstract voidonWriteAttempt(CacheEvent cacheEvent)Triggered at the start of the process to save a resource in cache. abstract voidonWriteSuccess(CacheEvent cacheEvent)Triggered after a resource has been successfully written to cache. abstract voidonReadException(CacheEvent cacheEvent)Triggered if a cache hit was attempted but an exception was thrown trying to read the resourcefrom storage. abstract voidonWriteException(CacheEvent cacheEvent)Triggered if a cache write was attempted but an exception was thrown trying to write theexception to storage. abstract voidonEviction(CacheEvent cacheEvent)Triggered by an eviction from cache. abstract voidonCleared()Triggered by a full cache clearance. -
-
Method Detail
-
onHit
abstract void onHit(CacheEvent cacheEvent)
Triggered by a cache hit.
-
onMiss
abstract void onMiss(CacheEvent cacheEvent)
Triggered by a cache miss for the given key.
-
onWriteAttempt
abstract void onWriteAttempt(CacheEvent cacheEvent)
Triggered at the start of the process to save a resource in cache.
-
onWriteSuccess
abstract void onWriteSuccess(CacheEvent cacheEvent)
Triggered after a resource has been successfully written to cache.
-
onReadException
abstract void onReadException(CacheEvent cacheEvent)
Triggered if a cache hit was attempted but an exception was thrown trying to read the resourcefrom storage.
-
onWriteException
abstract void onWriteException(CacheEvent cacheEvent)
Triggered if a cache write was attempted but an exception was thrown trying to write theexception to storage.
-
onEviction
abstract void onEviction(CacheEvent cacheEvent)
Triggered by an eviction from cache.
-
onCleared
abstract void onCleared()
Triggered by a full cache clearance.
-
-
-
-