ehcache

net.sf.ehcache.management.sampled
Class SampledCache

java.lang.Object
  extended by javax.management.StandardMBean
      extended by net.sf.ehcache.hibernate.management.impl.BaseEmitterBean
          extended by net.sf.ehcache.management.sampled.SampledCache
All Implemented Interfaces:
PropertyChangeListener, EventListener, DynamicMBean, MBeanRegistration, NotificationBroadcaster, NotificationEmitter, CacheConfigurationListener, SampledCacheMBean, LiveCacheStatistics, SampledCacheStatistics

public class SampledCache
extends BaseEmitterBean
implements SampledCacheMBean, CacheConfigurationListener, PropertyChangeListener

An implementation of SampledCacheMBean

Since:
1.7
Author:
Abhishek Sanoujam

Field Summary
 
Fields inherited from class net.sf.ehcache.hibernate.management.impl.BaseEmitterBean
emitter, sequenceNumber
 
Fields inherited from interface net.sf.ehcache.management.sampled.SampledCacheMBean
CACHE_CHANGED, CACHE_CLEARED, CACHE_ENABLED, CACHE_FLUSHED, CACHE_STATISTICS_ENABLED, CACHE_STATISTICS_RESET
 
Constructor Summary
SampledCache(Ehcache cache)
          Constructor accepting the backing Ehcache
 
Method Summary
 void clearStatistics()
          Clear both sampled and cumulative statistics
 void deregistered(CacheConfiguration config)
          Indicates that this listener was removed from the given configuration
 void disableSampledStatistics()
          Disables statistics collection
 void disableStatistics()
          Disables statistics collection.
 void diskCapacityChanged(int oldCapacity, int newCapacity)
          Indicates a change in the configurations disk store capacity
protected  void doDispose()
          Dispose callback of subclasses
 void enableSampledStatistics()
          Enables statistics collection.
 void enableStatistics()
          Enables statistics collection
 void flush()
          Flushes all cache items from memory to the disk store, and from the DiskStore to disk.
 float getAverageGetTimeMillis()
          Average time in milli seconds taken to get an element from the cache.
 long getAverageGetTimeMostRecentSample()
          Get most recent value for average time taken for get() operation in the cache
 long getAverageSearchTime()
          Get the average search execution time for searches finishing within the last sample period
 Map<String,Object> getCacheAttributes()
          getCacheAttributes
 long getCacheElementEvictedMostRecentSample()
          Get most recent value element evicted from cache
 long getCacheElementExpiredMostRecentSample()
          Get most recent value element expired from cache
 long getCacheElementPutMostRecentSample()
          Get most recent value element puts in the cache
 long getCacheElementRemovedMostRecentSample()
          Get most recent value element removed from cache
 long getCacheElementUpdatedMostRecentSample()
          Get most recent value element updates , i.e.
 long getCacheHitCount()
          The number of times a requested item was found in the cache.
 long getCacheHitInMemoryMostRecentSample()
          Get most recent value for in-memory cache hit
 long getCacheHitMostRecentSample()
          Get most recent value for cache hit
 long getCacheHitOffHeapMostRecentSample()
          Get most recent value for off-heap cache hit
 long getCacheHitOnDiskMostRecentSample()
          Get most recent value for on-disk cache hit
 long getCacheMissCount()
          
 long getCacheMissCountExpired()
          
 long getCacheMissExpiredMostRecentSample()
          Get most recent value for cache miss as result of the element getting expired
 long getCacheMissInMemoryMostRecentSample()
          Get most recent value for in-memory cache miss
 long getCacheMissMostRecentSample()
          Get most recent value for cache miss
 long getCacheMissNotFoundMostRecentSample()
          Get most recent value for cache miss as result of the element not found in cache
 long getCacheMissOffHeapMostRecentSample()
          Get most recent value for off-heap cache miss
 long getCacheMissOnDiskMostRecentSample()
          Get most recent value for on-disk cache miss
 String getCacheName()
          
 long getCacheXaCommitsMostRecentSample()
          Get most recent value of XA commits
 long getCacheXaRollbacksMostRecentSample()
          Get most recent value of XA rollbacks
 long getConfigDiskExpiryThreadIntervalSeconds()
          Configuration property accessor
 int getConfigMaxElementsInMemory()
          Configuration property accessor
 int getConfigMaxElementsOnDisk()
          Configuration property accessor
 String getConfigMemoryStoreEvictionPolicy()
          Configuration property accessor
 long getConfigTimeToIdleSeconds()
          Configuration property accessor
 long getConfigTimeToLiveSeconds()
          Configuration property accessor
 long getEvictedCount()
          Number of elements evicted from the cache
 long getExpiredCount()
          Number of elements expired since creation or last clear
 boolean getHasWriteBehindWriter()
          Is there a registered Write-behind CacheWriter
 long getInMemoryHitCount()
          Number of times a requested item was found in the Memory Store.
 long getInMemoryMissCount()
          Number of times a requested item was not found in the Memory Store.
 long getInMemorySize()
          Number of elements in the MemoryStore
 long getMaxGetTimeMillis()
          Return maximum time taken for a get operation in the cache in milliseconds
 long getMinGetTimeMillis()
          Return minimum time taken for a get operation in the cache in milliseconds
 MBeanNotificationInfo[] getNotificationInfo()
           
 long getOffHeapHitCount()
          Number of times a requested item was found in the off-heap store.
 long getOffHeapMissCount()
          Number of times a requested item was not found in the off-heap store.
 long getOffHeapSize()
          Number of elements in the off-heap store
 long getOnDiskHitCount()
          Number of times a requested item was found in the Disk Store.
 long getOnDiskMissCount()
          Number of times a requested item was not found in the Disk Store.
 long getOnDiskSize()
          Number of elements in the DiskStore
 long getPutCount()
          Number of puts that has happened in the cache
 long getRemovedCount()
          Number of elements removed since creation or last clear
 boolean getSearchable()
          Is the cache configured for search
 long getSearchesPerSecond()
          Get the number of searches that have finished execution in the last second
 long getSize()
          Size of the cache based on current accuracy settings.
 int getStatisticsAccuracy()
          Accurately measuring statistics can be expensive.
 String getStatisticsAccuracyDescription()
          Accurately measuring statistics can be expensive.
 String getStatus()
          Gets the status attribute of the Cache.
 String getTerracottaConsistency()
          Returns a textual description of a Terracotta-clustered cache's consistency mode.
 String getTerracottaStorageStrategy()
          Returns a textual description of a Terracotta-clustered cache's storage-strategy.
 boolean getTransactional()
          Is the cache a transactional one
 long getUpdateCount()
          Number of updates that as happened in the cache
 int getWriterConcurrency()
          Returns the number of configured write-behind queues/threads.
 int getWriterMaxQueueSize()
          Returns the maximum size of any write-behind queues.
 long getWriterQueueLength()
          Gets the size of the write-behind queue, if any.
 long getXaCommitCount()
          Return the Cache's XAResource commit calls count
 long getXaRollbackCount()
          Return the Cache's XAResource rollback calls count
 boolean isClusterBulkLoadEnabled()
          Is the cache in bulk-load mode cluster-wide?
 boolean isClusterCoherent()
          Deprecated. use isClusterBulkLoadEnabled() instead
 boolean isConfigDiskPersistent()
          Configuration property accessor
 boolean isConfigEternal()
          Configuration property accessor
 boolean isConfigLoggingEnabled()
          Configuration property accessor
 boolean isConfigOverflowToDisk()
          Configuration property accessor
 boolean isEnabled()
          Is the cache enabled?
 boolean isNodeBulkLoadEnabled()
          Is the cache in bulk-load mode locally?
 boolean isNodeCoherent()
          Deprecated. use isNodeBulkLoadEnabled() instead
 boolean isSampledStatisticsEnabled()
          Returns true if statistics collection is enabled for cache, otherwise false
 boolean isStatisticsEnabled()
          Returns true if statistics is enabled
 boolean isTerracottaClustered()
          Is the cache configured with Terracotta clustering?
 void loggingChanged(boolean oldValue, boolean newValue)
          Indicates a change in the configuration for enable/disable logging
 void memoryCapacityChanged(int oldCapacity, int newCapacity)
          Indicates a change in the configurations memory store capacity
 void propertyChange(PropertyChangeEvent evt)
           
 void registered(CacheConfiguration config)
          Indicates that this listener was registered with the given configuration
 void removeAll()
          Removes all cached items.
 void setConfigDiskExpiryThreadIntervalSeconds(long seconds)
          setConfigDiskExpiryThreadIntervalSeconds
 void setConfigDiskPersistent(boolean diskPersistent)
          setConfigDiskPersistent
 void setConfigEternal(boolean eternal)
          setConfigEternal
 void setConfigLoggingEnabled(boolean enabled)
          setConfigLoggingEnabled
 void setConfigMaxElementsInMemory(int maxElements)
          setConfigMaxElementsInMemory
 void setConfigMaxElementsOnDisk(int maxElements)
          setConfigMaxElementsOnDisk
 void setConfigMemoryStoreEvictionPolicy(String evictionPolicy)
          setConfigMemoryStoreEvictionPolicy
 void setConfigOverflowToDisk(boolean overflowToDisk)
          setConfigOverflowToDisk
 void setConfigTimeToIdleSeconds(long tti)
          setConfigTimeToIdleSeconds
 void setConfigTimeToLiveSeconds(long ttl)
          setConfigTimeToLiveSeconds
 void setEnabled(boolean enabled)
          Enabled/disable the cache.
 void setNodeBulkLoadEnabled(boolean bulkLoadEnabled)
          Enabled/disable bulk-load mode for this node.
 void setNodeCoherent(boolean coherent)
          Deprecated. use setNodeBulkLoadEnabled(boolean) instead
 void setStatisticsEnabled(boolean statsEnabled)
          Controls the statistics.
 void timeToIdleChanged(long oldTimeToIdle, long newTimeToIdle)
          Indicates a change in the configurations time to idle
 void timeToLiveChanged(long oldTimeToLive, long newTimeToLive)
          Indicates a change in the configurations time to live
 
Methods inherited from class net.sf.ehcache.hibernate.management.impl.BaseEmitterBean
addNotificationListener, dispose, removeNotificationListener, removeNotificationListener, sendNotification, sendNotification, sendNotification
 
Methods inherited from class javax.management.StandardMBean
cacheMBeanInfo, getAttribute, getAttributes, getCachedMBeanInfo, getClassName, getConstructors, getDescription, getDescription, getDescription, getDescription, getDescription, getDescription, getDescription, getImpact, getImplementation, getImplementationClass, getMBeanInfo, getMBeanInterface, getParameterName, getParameterName, invoke, postDeregister, postRegister, preDeregister, preRegister, setAttribute, setAttributes, setImplementation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.ehcache.statistics.sampled.SampledCacheStatistics
dispose
 

Constructor Detail

SampledCache

public SampledCache(Ehcache cache)
             throws NotCompliantMBeanException
Constructor accepting the backing Ehcache

Parameters:
cache -
Throws:
NotCompliantMBeanException
Method Detail

isEnabled

public boolean isEnabled()
Is the cache enabled?

Specified by:
isEnabled in interface SampledCacheMBean

setEnabled

public void setEnabled(boolean enabled)
Enabled/disable the cache.

Specified by:
setEnabled in interface SampledCacheMBean

isClusterCoherent

@Deprecated
public boolean isClusterCoherent()
Deprecated. use isClusterBulkLoadEnabled() instead

Is the cache coherent cluster-wide?

Specified by:
isClusterCoherent in interface SampledCacheMBean

isClusterBulkLoadEnabled

public boolean isClusterBulkLoadEnabled()
Is the cache in bulk-load mode cluster-wide?

Specified by:
isClusterBulkLoadEnabled in interface SampledCacheMBean

isNodeCoherent

@Deprecated
public boolean isNodeCoherent()
Deprecated. use isNodeBulkLoadEnabled() instead

Is the cache coherent locally?

Specified by:
isNodeCoherent in interface SampledCacheMBean

isNodeBulkLoadEnabled

public boolean isNodeBulkLoadEnabled()
Is the cache in bulk-load mode locally?

Specified by:
isNodeBulkLoadEnabled in interface SampledCacheMBean

setNodeCoherent

@Deprecated
public void setNodeCoherent(boolean coherent)
Deprecated. use setNodeBulkLoadEnabled(boolean) instead

Enabled/disable cache coherence mode for this node.

Specified by:
setNodeCoherent in interface SampledCacheMBean

setNodeBulkLoadEnabled

public void setNodeBulkLoadEnabled(boolean bulkLoadEnabled)
Enabled/disable bulk-load mode for this node.

Specified by:
setNodeBulkLoadEnabled in interface SampledCacheMBean

flush

public void flush()
Flushes all cache items from memory to the disk store, and from the DiskStore to disk.

Specified by:
flush in interface SampledCacheMBean

getCacheName

public String getCacheName()

Specified by:
getCacheName in interface LiveCacheStatistics
Returns:
the name of the Ehcache

getStatus

public String getStatus()
Gets the status attribute of the Cache.

Specified by:
getStatus in interface SampledCacheMBean
Returns:
The status value from the Status enum class

removeAll

public void removeAll()
Removes all cached items.

Specified by:
removeAll in interface SampledCacheMBean

getAverageGetTimeMostRecentSample

public long getAverageGetTimeMostRecentSample()
Get most recent value for average time taken for get() operation in the cache

Specified by:
getAverageGetTimeMostRecentSample in interface SampledCacheStatistics
Returns:
Most recent sample of average get time taken for a get operation

getCacheElementEvictedMostRecentSample

public long getCacheElementEvictedMostRecentSample()
Get most recent value element evicted from cache

Specified by:
getCacheElementEvictedMostRecentSample in interface SampledCacheStatistics
Returns:
Most recent sample for element evicted count

getCacheElementExpiredMostRecentSample

public long getCacheElementExpiredMostRecentSample()
Get most recent value element expired from cache

Specified by:
getCacheElementExpiredMostRecentSample in interface SampledCacheStatistics
Returns:
Most recent value for element expired count

getCacheElementPutMostRecentSample

public long getCacheElementPutMostRecentSample()
Get most recent value element puts in the cache

Specified by:
getCacheElementPutMostRecentSample in interface SampledCacheStatistics
Returns:
Most recent sample for number of element puts

getCacheElementRemovedMostRecentSample

public long getCacheElementRemovedMostRecentSample()
Get most recent value element removed from cache

Specified by:
getCacheElementRemovedMostRecentSample in interface SampledCacheStatistics
Returns:
Most recent sample for element removed count

getCacheElementUpdatedMostRecentSample

public long getCacheElementUpdatedMostRecentSample()
Get most recent value element updates , i.e. put() on elements with already existing keys in the cache

Specified by:
getCacheElementUpdatedMostRecentSample in interface SampledCacheStatistics
Returns:
Most recent sampled value for element update count

getCacheHitInMemoryMostRecentSample

public long getCacheHitInMemoryMostRecentSample()
Get most recent value for in-memory cache hit

Specified by:
getCacheHitInMemoryMostRecentSample in interface SampledCacheStatistics
Returns:
Most recent sample for cache hit count in memory

getCacheHitOffHeapMostRecentSample

public long getCacheHitOffHeapMostRecentSample()
Get most recent value for off-heap cache hit

Specified by:
getCacheHitOffHeapMostRecentSample in interface SampledCacheStatistics
Returns:
Most recent sample for cache hit count in off-heap

getCacheHitMostRecentSample

public long getCacheHitMostRecentSample()
Get most recent value for cache hit

Specified by:
getCacheHitMostRecentSample in interface SampledCacheStatistics
Returns:
Most recent sample for cache hit count

getCacheHitOnDiskMostRecentSample

public long getCacheHitOnDiskMostRecentSample()
Get most recent value for on-disk cache hit

Specified by:
getCacheHitOnDiskMostRecentSample in interface SampledCacheStatistics
Returns:
Most recent sample for cache hit count on disk

getCacheMissExpiredMostRecentSample

public long getCacheMissExpiredMostRecentSample()
Get most recent value for cache miss as result of the element getting expired

Specified by:
getCacheMissExpiredMostRecentSample in interface SampledCacheStatistics
Returns:
Most recent sample for cache miss count and the reason for miss being the element got expired

getCacheMissMostRecentSample

public long getCacheMissMostRecentSample()
Get most recent value for cache miss

Specified by:
getCacheMissMostRecentSample in interface SampledCacheStatistics
Returns:
Most recent sample for cache miss count

getCacheMissInMemoryMostRecentSample

public long getCacheMissInMemoryMostRecentSample()
Get most recent value for in-memory cache miss

Specified by:
getCacheMissInMemoryMostRecentSample in interface SampledCacheStatistics
Returns:
Most recent sample for cache miss count in memory

getCacheMissOffHeapMostRecentSample

public long getCacheMissOffHeapMostRecentSample()
Get most recent value for off-heap cache miss

Specified by:
getCacheMissOffHeapMostRecentSample in interface SampledCacheStatistics
Returns:
Most recent sample for cache miss count in off-heap

getCacheMissOnDiskMostRecentSample

public long getCacheMissOnDiskMostRecentSample()
Get most recent value for on-disk cache miss

Specified by:
getCacheMissOnDiskMostRecentSample in interface SampledCacheStatistics
Returns:
Most recent sample for cache miss count on disk

getCacheMissNotFoundMostRecentSample

public long getCacheMissNotFoundMostRecentSample()
Get most recent value for cache miss as result of the element not found in cache

Specified by:
getCacheMissNotFoundMostRecentSample in interface SampledCacheStatistics
Returns:
Most recent sample for cache miss not found count

getStatisticsAccuracy

public int getStatisticsAccuracy()
Accurately measuring statistics can be expensive. Returns the current accuracy setting.

Specified by:
getStatisticsAccuracy in interface LiveCacheStatistics
Specified by:
getStatisticsAccuracy in interface SampledCacheStatistics
Returns:
one of Statistics.STATISTICS_ACCURACY_BEST_EFFORT, Statistics.STATISTICS_ACCURACY_GUARANTEED, Statistics.STATISTICS_ACCURACY_NONE

getStatisticsAccuracyDescription

public String getStatisticsAccuracyDescription()
Accurately measuring statistics can be expensive. Returns the current accuracy setting.

Specified by:
getStatisticsAccuracyDescription in interface LiveCacheStatistics
Specified by:
getStatisticsAccuracyDescription in interface SampledCacheStatistics
Returns:
a human readable description of the accuracy setting. One of "None", "Best Effort" or "Guaranteed".

clearStatistics

public void clearStatistics()
Clear both sampled and cumulative statistics

Specified by:
clearStatistics in interface SampledCacheMBean
Specified by:
clearStatistics in interface LiveCacheStatistics
Specified by:
clearStatistics in interface SampledCacheStatistics

isStatisticsEnabled

public boolean isStatisticsEnabled()
Returns true if statistics is enabled

Specified by:
isStatisticsEnabled in interface LiveCacheStatistics
Returns:
true if statistics is enabled

isSampledStatisticsEnabled

public boolean isSampledStatisticsEnabled()
Returns true if statistics collection is enabled for cache, otherwise false

Specified by:
isSampledStatisticsEnabled in interface SampledCacheStatistics
Returns:
true if sampled statistics is enabled, false otherwise

isTerracottaClustered

public boolean isTerracottaClustered()
Is the cache configured with Terracotta clustering?

Specified by:
isTerracottaClustered in interface SampledCacheMBean
Returns:
true if clustered with terracotta

getTerracottaConsistency

public String getTerracottaConsistency()
Returns a textual description of a Terracotta-clustered cache's consistency mode.

Specified by:
getTerracottaConsistency in interface SampledCacheMBean
Returns:
"STRONG", "EVENTUAL", or "na" if the cache is not Terracotta-clustered

getTerracottaStorageStrategy

public String getTerracottaStorageStrategy()
Returns a textual description of a Terracotta-clustered cache's storage-strategy.

Specified by:
getTerracottaStorageStrategy in interface SampledCacheMBean
Returns:
"CDV2", "CLASSIC", or "na" if the cache is not Terracotta-clustered

enableStatistics

public void enableStatistics()
Enables statistics collection

Specified by:
enableStatistics in interface SampledCacheMBean
See Also:
SampledCacheMBean.enableStatistics()

disableStatistics

public void disableStatistics()
Disables statistics collection. Also disables sampled statistics if it is enabled.

Specified by:
disableStatistics in interface SampledCacheMBean
See Also:
SampledCacheMBean.disableStatistics()

setStatisticsEnabled

public void setStatisticsEnabled(boolean statsEnabled)
Controls the statistics. Also controls sampled statistics if it is enabled.

Specified by:
setStatisticsEnabled in interface SampledCacheMBean
See Also:
SampledCacheMBean.setStatisticsEnabled(boolean)

enableSampledStatistics

public void enableSampledStatistics()
Enables statistics collection. As it requires that normal statistics collection to be enabled, it enables it if its not already

Specified by:
enableSampledStatistics in interface SampledCacheMBean
See Also:
SampledCacheMBean.enableSampledStatistics()

disableSampledStatistics

public void disableSampledStatistics()
Disables statistics collection

Specified by:
disableSampledStatistics in interface SampledCacheMBean
See Also:
()

getAverageGetTimeMillis

public float getAverageGetTimeMillis()
Average time in milli seconds taken to get an element from the cache.

Specified by:
getAverageGetTimeMillis in interface LiveCacheStatistics
Returns:
Average time taken for a get operation in milliseconds
See Also:
LiveCacheStatistics.getAverageGetTimeMillis()

getMaxGetTimeMillis

public long getMaxGetTimeMillis()
Return maximum time taken for a get operation in the cache in milliseconds

Specified by:
getMaxGetTimeMillis in interface LiveCacheStatistics
Returns:
maximum time taken for a get operation in the cache in milliseconds
See Also:
LiveCacheStatistics.getMaxGetTimeMillis()

getXaCommitCount

public long getXaCommitCount()
Return the Cache's XAResource commit calls count

Specified by:
getXaCommitCount in interface LiveCacheStatistics
Returns:
the Cache's XAResource commit calls count
See Also:
LiveCacheStatistics.getXaCommitCount()

getXaRollbackCount

public long getXaRollbackCount()
Return the Cache's XAResource rollback calls count

Specified by:
getXaRollbackCount in interface LiveCacheStatistics
Returns:
the Cache's XAResource rollback calls count
See Also:
LiveCacheStatistics.getXaRollbackCount()

getHasWriteBehindWriter

public boolean getHasWriteBehindWriter()
Is there a registered Write-behind CacheWriter

Specified by:
getHasWriteBehindWriter in interface SampledCacheMBean

getWriterQueueLength

public long getWriterQueueLength()
Gets the size of the write-behind queue, if any. The value is for all local buckets

Specified by:
getWriterQueueLength in interface LiveCacheStatistics
Returns:
Elements waiting to be processed by the write-behind writer. -1 if no write-behind
See Also:
LiveCacheStatistics.getWriterQueueLength()

getWriterMaxQueueSize

public int getWriterMaxQueueSize()
Returns the maximum size of any write-behind queues.

Specified by:
getWriterMaxQueueSize in interface SampledCacheMBean
Returns:
Maximum elements that can be queued for processing by the write-behind writer
See Also:
CacheWriterConfiguration.getWriteBehindMaxQueueSize()

getWriterConcurrency

public int getWriterConcurrency()
Returns the number of configured write-behind queues/threads.

Specified by:
getWriterConcurrency in interface SampledCacheMBean
Returns:
Number of configured processing queues/threads for use by the write-behind writer
See Also:
CacheWriterConfiguration.getWriteBehindConcurrency()

getMinGetTimeMillis

public long getMinGetTimeMillis()
Return minimum time taken for a get operation in the cache in milliseconds

Specified by:
getMinGetTimeMillis in interface LiveCacheStatistics
Returns:
minimum time taken for a get operation in the cache in milliseconds
See Also:
LiveCacheStatistics.getMinGetTimeMillis()

getCacheHitCount

public long getCacheHitCount()
The number of times a requested item was found in the cache.

Specified by:
getCacheHitCount in interface LiveCacheStatistics
Returns:
the number of times a requested item was found in the cache
See Also:
LiveCacheStatistics.getCacheHitCount()

getCacheMissCount

public long getCacheMissCount()

Specified by:
getCacheMissCount in interface LiveCacheStatistics
Returns:
the number of times a requested element was not found in the cache
See Also:
LiveCacheStatistics.getCacheMissCount()

getInMemoryMissCount

public long getInMemoryMissCount()
Number of times a requested item was not found in the Memory Store.

Specified by:
getInMemoryMissCount in interface LiveCacheStatistics
Returns:
the number of times a requested item was not found in memory
See Also:
LiveCacheStatistics.getInMemoryMissCount()

getOffHeapMissCount

public long getOffHeapMissCount()
Number of times a requested item was not found in the off-heap store.

Specified by:
getOffHeapMissCount in interface LiveCacheStatistics
Returns:
the number of times a requested item was not found in off-heap
See Also:
LiveCacheStatistics.getOffHeapMissCount()

getOnDiskMissCount

public long getOnDiskMissCount()
Number of times a requested item was not found in the Disk Store.

Specified by:
getOnDiskMissCount in interface LiveCacheStatistics
Returns:
the number of times a requested item was not found on Disk, or 0 if there is no disk storage configured.
See Also:
LiveCacheStatistics.getOnDiskMissCount()

getCacheMissCountExpired

public long getCacheMissCountExpired()

Specified by:
getCacheMissCountExpired in interface LiveCacheStatistics
Returns:
the number of times a requested element was not found in the cache and the reason being the element already expired
See Also:
LiveCacheStatistics.getCacheMissCountExpired()

getConfigDiskExpiryThreadIntervalSeconds

public long getConfigDiskExpiryThreadIntervalSeconds()
Configuration property accessor

Specified by:
getConfigDiskExpiryThreadIntervalSeconds in interface SampledCacheMBean
Returns:
Value for disk expiry thread interval in seconds specified in config
See Also:
SampledCacheMBean.getConfigDiskExpiryThreadIntervalSeconds()

setConfigDiskExpiryThreadIntervalSeconds

public void setConfigDiskExpiryThreadIntervalSeconds(long seconds)
setConfigDiskExpiryThreadIntervalSeconds

Specified by:
setConfigDiskExpiryThreadIntervalSeconds in interface SampledCacheMBean
See Also:
SampledCacheMBean.setConfigDiskExpiryThreadIntervalSeconds(long)

getConfigMaxElementsInMemory

public int getConfigMaxElementsInMemory()
Configuration property accessor

Specified by:
getConfigMaxElementsInMemory in interface SampledCacheMBean
Returns:
Max elements in memory config setting value
See Also:
SampledCacheMBean.getConfigMaxElementsInMemory()

setConfigMaxElementsInMemory

public void setConfigMaxElementsInMemory(int maxElements)
setConfigMaxElementsInMemory

Specified by:
setConfigMaxElementsInMemory in interface SampledCacheMBean
See Also:
SampledCacheMBean.setConfigMaxElementsInMemory(int)

getConfigMaxElementsOnDisk

public int getConfigMaxElementsOnDisk()
Configuration property accessor

Specified by:
getConfigMaxElementsOnDisk in interface SampledCacheMBean
Returns:
Max elements on disk config setting value
See Also:
SampledCacheMBean.getConfigMaxElementsOnDisk()

setConfigMaxElementsOnDisk

public void setConfigMaxElementsOnDisk(int maxElements)
setConfigMaxElementsOnDisk

Specified by:
setConfigMaxElementsOnDisk in interface SampledCacheMBean
See Also:
SampledCacheMBean.setConfigMaxElementsOnDisk(int)

getConfigMemoryStoreEvictionPolicy

public String getConfigMemoryStoreEvictionPolicy()
Configuration property accessor

Specified by:
getConfigMemoryStoreEvictionPolicy in interface SampledCacheMBean
Returns:
a String representation of the policy
See Also:
SampledCacheMBean.getConfigMemoryStoreEvictionPolicy()

setConfigMemoryStoreEvictionPolicy

public void setConfigMemoryStoreEvictionPolicy(String evictionPolicy)
setConfigMemoryStoreEvictionPolicy

Specified by:
setConfigMemoryStoreEvictionPolicy in interface SampledCacheMBean
See Also:
SampledCacheMBean.setConfigMemoryStoreEvictionPolicy(String)

getConfigTimeToIdleSeconds

public long getConfigTimeToIdleSeconds()
Configuration property accessor

Specified by:
getConfigTimeToIdleSeconds in interface SampledCacheMBean
Returns:
TTI in config
See Also:
SampledCacheMBean.getConfigTimeToIdleSeconds()

setConfigTimeToIdleSeconds

public void setConfigTimeToIdleSeconds(long tti)
setConfigTimeToIdleSeconds

Specified by:
setConfigTimeToIdleSeconds in interface SampledCacheMBean
See Also:
SampledCacheMBean.setConfigTimeToIdleSeconds(long)

getConfigTimeToLiveSeconds

public long getConfigTimeToLiveSeconds()
Configuration property accessor

Specified by:
getConfigTimeToLiveSeconds in interface SampledCacheMBean
Returns:
TTL in config
See Also:
SampledCacheMBean.getConfigTimeToLiveSeconds()

setConfigTimeToLiveSeconds

public void setConfigTimeToLiveSeconds(long ttl)
setConfigTimeToLiveSeconds

Specified by:
setConfigTimeToLiveSeconds in interface SampledCacheMBean
See Also:
SampledCacheMBean.setConfigTimeToLiveSeconds(long)

isConfigDiskPersistent

public boolean isConfigDiskPersistent()
Configuration property accessor

Specified by:
isConfigDiskPersistent in interface SampledCacheMBean
Returns:
true if configured with disk persistence
See Also:
SampledCacheMBean.isConfigDiskPersistent()

setConfigDiskPersistent

public void setConfigDiskPersistent(boolean diskPersistent)
setConfigDiskPersistent

Specified by:
setConfigDiskPersistent in interface SampledCacheMBean
See Also:
SampledCacheMBean.setConfigDiskPersistent(boolean)

isConfigEternal

public boolean isConfigEternal()
Configuration property accessor

Specified by:
isConfigEternal in interface SampledCacheMBean
Returns:
true if set to eternal in config
See Also:
SampledCacheMBean.isConfigEternal()

setConfigEternal

public void setConfigEternal(boolean eternal)
setConfigEternal

Specified by:
setConfigEternal in interface SampledCacheMBean
See Also:
SampledCacheMBean.setConfigEternal(boolean)

isConfigOverflowToDisk

public boolean isConfigOverflowToDisk()
Configuration property accessor

Specified by:
isConfigOverflowToDisk in interface SampledCacheMBean
Returns:
true if overflow to disk specified in config
See Also:
SampledCacheMBean.isConfigOverflowToDisk()

setConfigOverflowToDisk

public void setConfigOverflowToDisk(boolean overflowToDisk)
setConfigOverflowToDisk

Specified by:
setConfigOverflowToDisk in interface SampledCacheMBean
See Also:
SampledCacheMBean.setConfigOverflowToDisk(boolean)

isConfigLoggingEnabled

public boolean isConfigLoggingEnabled()
Configuration property accessor

Specified by:
isConfigLoggingEnabled in interface SampledCacheMBean
Returns:
true if logging is enabled on the cache
See Also:
SampledCacheMBean.isConfigLoggingEnabled()

setConfigLoggingEnabled

public void setConfigLoggingEnabled(boolean enabled)
setConfigLoggingEnabled

Specified by:
setConfigLoggingEnabled in interface SampledCacheMBean
See Also:
SampledCacheMBean.setConfigLoggingEnabled(boolean)

getEvictedCount

public long getEvictedCount()
Number of elements evicted from the cache

Specified by:
getEvictedCount in interface LiveCacheStatistics
Returns:
Number of elements evicted from the cache
See Also:
LiveCacheStatistics.getEvictedCount()

getExpiredCount

public long getExpiredCount()
Number of elements expired since creation or last clear

Specified by:
getExpiredCount in interface LiveCacheStatistics
Returns:
Number of expired elements
See Also:
LiveCacheStatistics.getExpiredCount()

getInMemoryHitCount

public long getInMemoryHitCount()
Number of times a requested item was found in the Memory Store.

Specified by:
getInMemoryHitCount in interface LiveCacheStatistics
Returns:
the number of times a requested item was found in memory
See Also:
LiveCacheStatistics.getInMemoryHitCount()

getInMemorySize

public long getInMemorySize()
Number of elements in the MemoryStore

Specified by:
getInMemorySize in interface LiveCacheStatistics
Returns:
the number of elements in memory
See Also:
LiveCacheStatistics.getInMemorySize()

getOffHeapHitCount

public long getOffHeapHitCount()
Number of times a requested item was found in the off-heap store.

Specified by:
getOffHeapHitCount in interface LiveCacheStatistics
Returns:
the number of times a requested item was found in off-heap
See Also:
LiveCacheStatistics.getOffHeapHitCount()

getOffHeapSize

public long getOffHeapSize()
Number of elements in the off-heap store

Specified by:
getOffHeapSize in interface LiveCacheStatistics
Returns:
the number of elements in off-heap
See Also:
LiveCacheStatistics.getOffHeapSize()

getOnDiskHitCount

public long getOnDiskHitCount()
Number of times a requested item was found in the Disk Store.

Specified by:
getOnDiskHitCount in interface LiveCacheStatistics
Returns:
the number of times a requested item was found on Disk, or 0 if there is no disk storage configured.
See Also:
LiveCacheStatistics.getOnDiskHitCount()

getOnDiskSize

public long getOnDiskSize()
Number of elements in the DiskStore

Specified by:
getOnDiskSize in interface LiveCacheStatistics
Returns:
number of elements on disk
See Also:
LiveCacheStatistics.getOnDiskSize()

getPutCount

public long getPutCount()
Number of puts that has happened in the cache

Specified by:
getPutCount in interface LiveCacheStatistics
Returns:
Number of puts
See Also:
LiveCacheStatistics.getPutCount()

getRemovedCount

public long getRemovedCount()
Number of elements removed since creation or last clear

Specified by:
getRemovedCount in interface LiveCacheStatistics
Returns:
Number of elements removed
See Also:
LiveCacheStatistics.getRemovedCount()

getSize

public long getSize()
Size of the cache based on current accuracy settings.

Specified by:
getSize in interface LiveCacheStatistics
Returns:
The size of the cache based on currect accuracy setting
See Also:
LiveCacheStatistics.getSize()

getUpdateCount

public long getUpdateCount()
Number of updates that as happened in the cache

Specified by:
getUpdateCount in interface LiveCacheStatistics
Returns:
Number of updates
See Also:
LiveCacheStatistics.getUpdateCount()

getCacheAttributes

public Map<String,Object> getCacheAttributes()
getCacheAttributes

Returns:
map of attribute name -> value

getNotificationInfo

public MBeanNotificationInfo[] getNotificationInfo()
Specified by:
getNotificationInfo in interface NotificationBroadcaster
Specified by:
getNotificationInfo in class BaseEmitterBean
See Also:
BaseEmitterBean.getNotificationInfo()

deregistered

public void deregistered(CacheConfiguration config)
Indicates that this listener was removed from the given configuration

Specified by:
deregistered in interface CacheConfigurationListener

diskCapacityChanged

public void diskCapacityChanged(int oldCapacity,
                                int newCapacity)
Indicates a change in the configurations disk store capacity

Specified by:
diskCapacityChanged in interface CacheConfigurationListener
Parameters:
oldCapacity - previous capacity
newCapacity - new capacity

loggingChanged

public void loggingChanged(boolean oldValue,
                           boolean newValue)
Indicates a change in the configuration for enable/disable logging

Specified by:
loggingChanged in interface CacheConfigurationListener
Parameters:
oldValue - old value whether logging was enabled or not
newValue - new value whether logging was enabled or not

memoryCapacityChanged

public void memoryCapacityChanged(int oldCapacity,
                                  int newCapacity)
Indicates a change in the configurations memory store capacity

Specified by:
memoryCapacityChanged in interface CacheConfigurationListener
Parameters:
oldCapacity - previous capacity
newCapacity - new capacity

registered

public void registered(CacheConfiguration config)
Indicates that this listener was registered with the given configuration

Specified by:
registered in interface CacheConfigurationListener

timeToIdleChanged

public void timeToIdleChanged(long oldTimeToIdle,
                              long newTimeToIdle)
Indicates a change in the configurations time to idle

Specified by:
timeToIdleChanged in interface CacheConfigurationListener
Parameters:
oldTimeToIdle - previous time to idle value
newTimeToIdle - new time to idle value

timeToLiveChanged

public void timeToLiveChanged(long oldTimeToLive,
                              long newTimeToLive)
Indicates a change in the configurations time to live

Specified by:
timeToLiveChanged in interface CacheConfigurationListener
Parameters:
oldTimeToLive - previous time to live value
newTimeToLive - new time to live value

propertyChange

public void propertyChange(PropertyChangeEvent evt)
Specified by:
propertyChange in interface PropertyChangeListener
See Also:
PropertyChangeListener.propertyChange(java.beans.PropertyChangeEvent)

doDispose

protected void doDispose()
Dispose callback of subclasses

Specified by:
doDispose in class BaseEmitterBean

getAverageSearchTime

public long getAverageSearchTime()
Get the average search execution time for searches finishing within the last sample period

Specified by:
getAverageSearchTime in interface SampledCacheStatistics

getSearchesPerSecond

public long getSearchesPerSecond()
Get the number of searches that have finished execution in the last second

Specified by:
getSearchesPerSecond in interface SampledCacheStatistics

getTransactional

public boolean getTransactional()
Is the cache a transactional one

Specified by:
getTransactional in interface SampledCacheMBean
See Also:
CacheConfiguration.TransactionalMode

getSearchable

public boolean getSearchable()
Is the cache configured for search

Specified by:
getSearchable in interface SampledCacheMBean
See Also:
Searchable

getCacheXaCommitsMostRecentSample

public long getCacheXaCommitsMostRecentSample()
Get most recent value of XA commits

Specified by:
getCacheXaCommitsMostRecentSample in interface SampledCacheStatistics

getCacheXaRollbacksMostRecentSample

public long getCacheXaRollbacksMostRecentSample()
Get most recent value of XA rollbacks

Specified by:
getCacheXaRollbacksMostRecentSample in interface SampledCacheStatistics

ehcache

true