ehcache

net.sf.ehcache.statistics
Interface LiveCacheStatisticsData

All Superinterfaces:
CacheEventListener, java.lang.Cloneable
All Known Implementing Classes:
LiveCacheStatisticsImpl, LiveCacheStatisticsWrapper, NullLiveCacheStatisticsData

public interface LiveCacheStatisticsData
extends CacheEventListener

Interface that classes storing usage statistics of a Cache will implement

Since:
1.7
Author:
Abhishek Sanoujam

Method Summary
 void addGetTimeMillis(long millis)
          Adds time taken for a get operation in the cache
 void cacheHitInMemory()
          Called on a cache hit in the MemoryStore
 void cacheHitOnDisk()
          Called on a cache hit in the DiskStore
 void cacheMissExpired()
          Called when an element is found in the cache but already expired
 void cacheMissNotFound()
          Called when an element is not found in the cache
 void clearStatistics()
          Clear existing statistics
 void registerCacheUsageListener(CacheUsageListener cacheUsageListener)
          Registers a CacheUsageListener which will be notified of the cache usage.
 void removeCacheUsageListener(CacheUsageListener cacheUsageListener)
          Remove an already registered CacheUsageListener, if any.
 void setStatisticsAccuracy(int statisticsAccuracy)
          Sets the statistics accuracy.
 void setStatisticsEnabled(boolean enableStatistics)
          Enabled/Disabled statistics
 
Methods inherited from interface net.sf.ehcache.event.CacheEventListener
clone, dispose, notifyElementEvicted, notifyElementExpired, notifyElementPut, notifyElementRemoved, notifyElementUpdated, notifyRemoveAll
 

Method Detail

setStatisticsEnabled

void setStatisticsEnabled(boolean enableStatistics)
Enabled/Disabled statistics

Parameters:
enableStatistics -

clearStatistics

void clearStatistics()
Clear existing statistics


cacheHitInMemory

void cacheHitInMemory()
Called on a cache hit in the MemoryStore


cacheHitOnDisk

void cacheHitOnDisk()
Called on a cache hit in the DiskStore


cacheMissNotFound

void cacheMissNotFound()
Called when an element is not found in the cache


cacheMissExpired

void cacheMissExpired()
Called when an element is found in the cache but already expired


addGetTimeMillis

void addGetTimeMillis(long millis)
Adds time taken for a get operation in the cache

Parameters:
millis -

setStatisticsAccuracy

void setStatisticsAccuracy(int statisticsAccuracy)
Sets the statistics accuracy.

Parameters:
statisticsAccuracy - one of Statistics#STATISTICS_ACCURACY_BEST_EFFORT, Statistics#STATISTICS_ACCURACY_GUARANTEED, Statistics#STATISTICS_ACCURACY_NONE

registerCacheUsageListener

void registerCacheUsageListener(CacheUsageListener cacheUsageListener)
                                throws java.lang.IllegalStateException
Registers a CacheUsageListener which will be notified of the cache usage. Implementations of CacheUsageListener should override the Object.equals(Object) and Object.hashCode() methods as it is used for equality check

Throws:
java.lang.IllegalStateException
Since:
1.7

removeCacheUsageListener

void removeCacheUsageListener(CacheUsageListener cacheUsageListener)
                              throws java.lang.IllegalStateException
Remove an already registered CacheUsageListener, if any. Depends on the Object.equals(Object) method.

Throws:
java.lang.IllegalStateException
Since:
1.7

ehcache

true