ehcache

net.sf.ehcache.statistics
Interface CacheUsageListener


public interface CacheUsageListener

Interface for listeners to any change in usage statistics of an Ehcache.

Implementations of this interface should implement the Object.equals(Object) and the Object.hashCode() as registering and removing listeners depends on these

Since:
1.7
Author:
Abhishek Sanoujam

Method Summary
 void dispose()
          Called to dispose off the listener
 void notifyCacheElementEvicted()
          Called when an element is expired in the cache
 void notifyCacheElementExpired()
          Called when an element in the cache expires
 void notifyCacheElementPut()
          Called when an element is inserted in the cache
 void notifyCacheElementRemoved()
          Called when an element is removed from the cache
 void notifyCacheElementUpdated()
          Called when an element is updated in the cache, i.e.
 void notifyCacheHitInMemory()
          Called on a cache hit in the MemoryStore
 void notifyCacheHitOffHeap()
          Called on a cache hit in the off-heap store
 void notifyCacheHitOnDisk()
          Called on a cache hit in the DiskStore
 void notifyCacheMissedWithExpired()
          Called when an element is found in the cache but already expired
 void notifyCacheMissedWithNotFound()
          Called when an element is not found in the cache
 void notifyCacheMissInMemory()
          Called on a cache miss in the MemoryStore
 void notifyCacheMissOffHeap()
          Called on a cache miss in the off-heap store
 void notifyCacheMissOnDisk()
          Called on a cache miss in the DiskStore
 void notifyCacheSearch(long executeTime)
          Called when a search finishes execution
 void notifyGetTimeNanos(long nanos)
          Notified with time taken for a get operation in the cache
 void notifyRemoveAll()
          Called when Cache.removeAll() is called
 void notifyStatisticsAccuracyChanged(int statisticsAccuracy)
          Notified when the statistics accuracy is changed.
 void notifyTimeTakenForGet(long millis)
          Deprecated.  
 void notifyXaCommit()
          Called when the Cache's XAResource has been asked to commit
 void notifyXaRollback()
          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 - one of Statistics#STATISTICS_ACCURACY_BEST_EFFORT, Statistics#STATISTICS_ACCURACY_GUARANTEED, Statistics#STATISTICS_ACCURACY_NONE

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


ehcache

Copyright 2001-2017, Terracotta, Inc.