ehcache

net.sf.ehcache.statistics
Interface LiveCacheStatisticsData

All Superinterfaces:
CacheEventListener, 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 cacheHitOffHeap()
          Called on a cache hit in the off-heap
 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 cacheMissInMemory()
          Called on a cache miss in the MemoryStore
 void cacheMissNotFound()
          Called when an element is not found in the cache
 void cacheMissOffHeap()
          Called on a cache miss in the off-heap
 void cacheMissOnDisk()
          Called on a cache miss in the DiskStore
 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
 void xaCommit()
          Called when the Cache's XAResource has been asked to commit
 void xaRollback()
          Called when the Cache's XAResource has been asked to rollback
 
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


cacheHitOffHeap

void cacheHitOffHeap()
Called on a cache hit in the off-heap


cacheHitOnDisk

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


cacheMissNotFound

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


cacheMissInMemory

void cacheMissInMemory()
Called on a cache miss in the MemoryStore


cacheMissOffHeap

void cacheMissOffHeap()
Called on a cache miss in the off-heap


cacheMissOnDisk

void cacheMissOnDisk()
Called on a cache miss in the DiskStore


cacheMissExpired

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


xaCommit

void xaCommit()
Called when the Cache's XAResource has been asked to commit


xaRollback

void xaRollback()
Called when the Cache's XAResource has been asked to rollback


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 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:
IllegalStateException
Since:
1.7

removeCacheUsageListener

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

Throws:
IllegalStateException
Since:
1.7

ehcache

Copyright © 2003-2012 Terracotta, Inc.. All Rights Reserved.