Package net.sf.ehcache.statistics
Interface CacheUsageListener
-
public interface CacheUsageListenerInterface for listeners to any change in usage statistics of an Ehcache.Implementations of this interface should implement the
Object.equals(Object)and theObject.hashCode()as registering and removing listeners depends on these- Since:
- 1.7
- Author:
- Abhishek Sanoujam
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voiddispose()Called to dispose off the listenervoidnotifyCacheElementEvicted()Called when an element is expired in the cachevoidnotifyCacheElementExpired()Called when an element in the cache expiresvoidnotifyCacheElementPut()Called when an element is inserted in the cachevoidnotifyCacheElementRemoved()Called when an element is removed from the cachevoidnotifyCacheElementUpdated()Called when an element is updated in the cache, i.e.voidnotifyCacheHitInMemory()Called on a cache hit in the MemoryStorevoidnotifyCacheHitOffHeap()Called on a cache hit in the off-heap storevoidnotifyCacheHitOnDisk()Called on a cache hit in the DiskStorevoidnotifyCacheMissedWithExpired()Called when an element is found in the cache but already expiredvoidnotifyCacheMissedWithNotFound()Called when an element is not found in the cachevoidnotifyCacheMissInMemory()Called on a cache miss in the MemoryStorevoidnotifyCacheMissOffHeap()Called on a cache miss in the off-heap storevoidnotifyCacheMissOnDisk()Called on a cache miss in the DiskStorevoidnotifyCacheSearch(long executeTime)Called when a search finishes executionvoidnotifyGetTimeNanos(long nanos)Notified with time taken for a get operation in the cachevoidnotifyRemoveAll()Called when Cache.removeAll() is calledvoidnotifyStatisticsAccuracyChanged(int statisticsAccuracy)Notified when the statistics accuracy is changed.voidnotifyTimeTakenForGet(long millis)Deprecated.voidnotifyXaCommit()Called when the Cache's XAResource has been asked to commitvoidnotifyXaRollback()Called when the Cache's XAResource has been asked to rollback
-
-
-
Method Detail
-
notifyCacheHitInMemory
void notifyCacheHitInMemory()
Called on a cache hit in the MemoryStore
-
notifyCacheHitOffHeap
void notifyCacheHitOffHeap()
Called on a cache hit in the off-heap store
-
notifyCacheHitOnDisk
void notifyCacheHitOnDisk()
Called on a cache hit in the DiskStore
-
notifyCacheElementPut
void notifyCacheElementPut()
Called when an element is inserted in the cache
-
notifyCacheElementUpdated
void notifyCacheElementUpdated()
Called when an element is updated in the cache, i.e. a put for an already existing key
-
notifyCacheMissedWithNotFound
void notifyCacheMissedWithNotFound()
Called when an element is not found in the cache
-
notifyCacheMissInMemory
void notifyCacheMissInMemory()
Called on a cache miss in the MemoryStore
-
notifyCacheMissOffHeap
void notifyCacheMissOffHeap()
Called on a cache miss in the off-heap store
-
notifyCacheMissOnDisk
void notifyCacheMissOnDisk()
Called on a cache miss in the DiskStore
-
notifyCacheMissedWithExpired
void notifyCacheMissedWithExpired()
Called when an element is found in the cache but already expired
-
notifyTimeTakenForGet
@Deprecated void notifyTimeTakenForGet(long millis)
Deprecated.Notified with time taken for a get operation in the cache DEPRECATED: use notifyGetTimeNanos(long)- Parameters:
millis-
-
notifyGetTimeNanos
void notifyGetTimeNanos(long nanos)
Notified with time taken for a get operation in the cache- Parameters:
nanos-
-
notifyCacheElementEvicted
void notifyCacheElementEvicted()
Called when an element is expired in the cache
-
notifyCacheElementExpired
void notifyCacheElementExpired()
Called when an element in the cache expires
-
notifyCacheElementRemoved
void notifyCacheElementRemoved()
Called when an element is removed from the cache
-
notifyRemoveAll
void notifyRemoveAll()
Called when Cache.removeAll() is called
-
notifyStatisticsAccuracyChanged
void notifyStatisticsAccuracyChanged(int statisticsAccuracy)
Notified when the statistics accuracy is changed.- Parameters:
statisticsAccuracy- the statistics accuracy
-
dispose
void dispose()
Called to dispose off the listener
-
notifyCacheSearch
void notifyCacheSearch(long executeTime)
Called when a search finishes execution- Parameters:
executeTime- elapsed time in millis
-
notifyXaCommit
void notifyXaCommit()
Called when the Cache's XAResource has been asked to commit
-
notifyXaRollback
void notifyXaRollback()
Called when the Cache's XAResource has been asked to rollback
-
-