Top Description Fields Constructors Methods
net.sf.ehcache.management.sampled

public Class SampledCache

extends BaseEmitterBean
implements SampledCacheMBean, PropertyChangeListener
Class Inheritance
All Implemented Interfaces
java.beans.PropertyChangeListener, java.util.EventListener, net.sf.ehcache.management.sampled.SampledCacheMBean, net.sf.ehcache.management.sampled.CacheSampler, net.sf.ehcache.management.sampled.LegacyCacheStatistics
Imports
net.sf.ehcache.Ehcache, net.sf.ehcache.hibernate.management.impl.BaseEmitterBean, net.sf.ehcache.util.counter.sampled.SampledCounter, .SampledRateCounter, org.slf4j.Logger, .LoggerFactory, javax.management.MBeanNotificationInfo, .NotCompliantMBeanException, .Notification, java.beans.PropertyChangeEvent, .PropertyChangeListener, java.util.HashMap, .Map

An implementation of SampledCacheMBean
Authors
Abhishek Sanoujam, byoukste

Field Summary

Modifier and TypeField and Description
private final String
private static final Logger
private static final MBeanNotificationInfo[]
private final CacheSamplerImpl
Inherited from net.sf.ehcache.hibernate.management.impl.BaseEmitterBean:
emittersequenceNumber

Constructor Summary

AccessConstructor and Description
public
SampledCache(Ehcache
the cache object to use in initializing this sampled jmx mbean
cache
)

Constructor accepting the backing Ehcache

Method Summary

Modifier and TypeMethod and Description
protected void
doDispose()

Implements abstract net.sf.ehcache.hibernate.management.impl.BaseEmitterBean.doDispose.

Dispose callback of subclasses
public void
flush()

Implements net.sf.ehcache.management.sampled.CacheSampler.flush.

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

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getAverageGetTimeNanos.

Average time in nanoseconds taken to get an element from the cache.
public long
getAverageGetTimeNanosMostRecentSample()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getAverageGetTimeNanosMostRecentSample.

Get most recent value for average time taken for get() operation in the cache.
public SampledRateCounter
getAverageGetTimeSample()

Implements net.sf.ehcache.management.sampled.CacheSampler.getAverageGetTimeSample.

Get the SampledRateCounter for average time taken for get() operation in the cache.
public long
public long
getAverageSearchTimeNanos()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getAverageSearchTimeNanos.

Get the average search execution time for searches finishing within the last sample period.
public SampledRateCounter
getAverageSearchTimeSample()

Implements net.sf.ehcache.management.sampled.CacheSampler.getAverageSearchTimeSample.

Get the SampledRateCounter for average search execution time for searches finishing within the last sample period.
public Map<String, Object>

Returns:

map of attribute name -> value
getCacheAttributes
()

getCacheAttributes

public long
public long
public long
public SampledCounter
public long
public long
public SampledCounter
public long
public long
public SampledCounter
public long
public SampledCounter
public long
public SampledCounter
public long
public SampledCounter
public long
public SampledCounter
public long
getCacheElementUpdatedMostRecentSample()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getCacheElementUpdatedMostRecentSample.

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

Implements net.sf.ehcache.management.sampled.CacheSampler.getCacheElementUpdatedSample.

Get the SampledCounter element updates , i.e. put() on elements with already existing keys in the cache
public long
public long
public long
getCacheHitCount()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getCacheHitCount.

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

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getCacheHitRatio.

The ratio of hits to accesses (hits + misses).
public int
public SampledCounter
public SampledCounter
public long
public long
public long
getCacheMissCount()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getCacheMissCount.

Number of times a requested element was not found in the cache.
public long
public long
getCacheMissExpiredMostRecentSample()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getCacheMissExpiredMostRecentSample.

Get most recent value for cache miss as result of the element getting expired.
public SampledCounter
getCacheMissExpiredSample()

Implements net.sf.ehcache.management.sampled.CacheSampler.getCacheMissExpiredSample.

Get the SampledCounter for cache miss as result of the element getting expired.
public long
public SampledCounter
public long
public long
getCacheMissNotFoundMostRecentSample()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getCacheMissNotFoundMostRecentSample.

Get most recent value for cache miss as result of the element not found in cache.
public SampledCounter
getCacheMissNotFoundSample()

Implements net.sf.ehcache.management.sampled.CacheSampler.getCacheMissNotFoundSample.

Get the SampledCounter for cache miss as result of the element not found in cache.
public long
public SampledCounter
public long
public SampledCounter
public long
public SampledCounter
public String
public long
public long
public long
public long
public long
public long
public long
public long
public long
public SampledCounter
getCacheXaCommitsSample()

Implements net.sf.ehcache.management.sampled.CacheSampler.getCacheXaCommitsSample.

Get the SampledCounter for number of XA Transaction commits that have completed in the interval.
public long
public SampledCounter
getCacheXaRollbacksSample()

Implements net.sf.ehcache.management.sampled.CacheSampler.getCacheXaRollbacksSample.

Get the SampledCounter for number of XA Transaction rollbacks that have completed in the interval.
public long
public long
getEvictedCount()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getEvictedCount.

Number of elements evicted from the cache.
public long
getExpiredCount()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getExpiredCount.

Number of elements expired since creation or last clear.
public boolean
getHasWriteBehindWriter()

Implements net.sf.ehcache.management.sampled.CacheSampler.getHasWriteBehindWriter.

Is there a registered Write-behind CacheWriter.
pack-priv String

Returns:

The name of the cache
getImmutableCacheName
()

Method which returns the name of the cache at construction time.

public long
getInMemoryHitCount()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getInMemoryHitCount.

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

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getInMemoryMissCount.

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

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getInMemorySize.

Deprecated use getLocalHeapSize()
Number of elements in the MemoryStore.
public long
public long
getLocalDiskSizeInBytes()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getLocalDiskSizeInBytes.

Number of of bytes used by entries in the DiskStore.
public SampledCounter
public SampledCounter
public long
public long
getLocalHeapSizeInBytes()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getLocalHeapSizeInBytes.

Number of of bytes used by entries in the MemoryStore.
public SampledCounter
public SampledCounter
public long
public long
getLocalOffHeapSizeInBytes()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getLocalOffHeapSizeInBytes.

Number of of bytes used by entries in the off-heap store.
public SampledCounter
public SampledCounter
public long
public String
public long
public String
public long
public String
public int
public int
public long
public long
public long
public Long
getMaxGetTimeNanos()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getMaxGetTimeNanos.

Return maximum time taken for a get operation in the cache in nanoseconds.
public String
public Long
getMinGetTimeNanos()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getMinGetTimeNanos.

Return minimum time taken for a get operation in the cache in nanoseconds.
public long
public SampledCounter
public long
public long
public long
getNonStopFailureRate()

Implements net.sf.ehcache.management.sampled.CacheSampler.getNonStopFailureRate.

Gets the non stop failure most recent sample.
public SampledCounter
public long
public long
public long
public SampledCounter
public long
public long
public long
getNonStopSuccessRate()

Implements net.sf.ehcache.management.sampled.CacheSampler.getNonStopSuccessRate.

Gets the non stop success most recent sample.
public SampledCounter
public long
public long
public long
getNonStopTimeoutRate()

Implements net.sf.ehcache.management.sampled.CacheSampler.getNonStopTimeoutRate.

Gets the non stop timeout most recent sample.
public int
getNonstopTimeoutRatio()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getNonstopTimeoutRatio.

Get the ratio of nonstop timeouts+rejoin timeouts to operations
public SampledCounter
public MBeanNotificationInfo[]
getNotificationInfo()

Implements abstract net.sf.ehcache.hibernate.management.impl.BaseEmitterBean.getNotificationInfo.

Implements javax.management.NotificationBroadcaster.getNotificationInfo.

Returns an array indicating, for each notification this MBean may send, the name of the Java class of the notification and the notification type.

public long
getOffHeapHitCount()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getOffHeapHitCount.

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

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getOffHeapMissCount.

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

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getOffHeapSize.

Deprecated use getLocalOffHeapSize()
Number of elements in the off-heap store.
public long
getOnDiskHitCount()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getOnDiskHitCount.

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

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getOnDiskMissCount.

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

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getOnDiskSize.

Deprecated use getLocalDiskSize()
Number of elements in the DiskStore.
public String
public String
public long
getPutCount()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getPutCount.

Number of puts that has happened in the cache.
public long
public long
public SampledCounter
public long
public long
public SampledCounter
public SampledCounter
public long
getRemovedCount()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getRemovedCount.

Number of elements removed since creation or last clear.
public long
public long
public SampledCounter
public long
public long
public SampledCounter
public long
public long
public SampledCounter
public long
public long
public SampledCounter
public long
public long
public SampledCounter
public long
public long
public SampledCounter
public boolean
getSearchable()

Implements net.sf.ehcache.management.sampled.CacheSampler.getSearchable.

Is the cache configured for search.
public Map<String, String>
getSearchAttributes()

Implements net.sf.ehcache.management.sampled.CacheSampler.getSearchAttributes.

Get the declared search attributes and their type names.
public long
getSearchesPerSecond()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getSearchesPerSecond.

Get the number of searches that have finished execution in the last second.
public SampledCounter
getSearchesPerSecondSample()

Implements net.sf.ehcache.management.sampled.CacheSampler.getSearchesPerSecondSample.

Get the SampledCounter for number of searches that have finished in the interval.
public long
getSize()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getSize.

Size of the cache based on current accuracy settings.
public SampledCounter
public String
getStatus()

Implements net.sf.ehcache.management.sampled.CacheSampler.getStatus.

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

Implements net.sf.ehcache.management.sampled.CacheSampler.getTerracottaConsistency.

Returns a textual description of a Terracotta-clustered cache's consistency mode.
public long
public long
public boolean
public long
public long
public long
getUpdateCount()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getUpdateCount.

Number of updates that as happened in the cache.
public int
getWriterConcurrency()

Implements net.sf.ehcache.management.sampled.CacheSampler.getWriterConcurrency.

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

Implements net.sf.ehcache.management.sampled.CacheSampler.getWriterMaxQueueSize.

Returns the maximum size of any write-behind queues.
public long
getWriterQueueLength()

Implements net.sf.ehcache.management.sampled.CacheSampler.getWriterQueueLength.

Returns the total length of all write-behind queues for this cache.
public SampledCounter
public long
getXaCommitCount()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getXaCommitCount.

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

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getXaRecoveredCount.

Return the Cache's XAResource recovered XIDs count.
public long
getXaRollbackCount()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getXaRollbackCount.

Return the Cache's XAResource rollback calls count.
public boolean
public boolean
isClusterCoherent()

Implements net.sf.ehcache.management.sampled.SampledCacheMBean.isClusterCoherent.

Deprecated
Is the cache coherent cluster-wide?
public boolean
public boolean
public boolean
isEternal()

Implements net.sf.ehcache.management.sampled.CacheSampler.isEternal.

Configuration property accessor.
public boolean
isLocalHeapCountBased()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.isLocalHeapCountBased.

Check if the local heap is measured with ARC or in element count.
public boolean
public boolean
public boolean
isNodeCoherent()

Implements net.sf.ehcache.management.sampled.SampledCacheMBean.isNodeCoherent.

Deprecated
Is the cache coherent locally?
public boolean
public boolean
public boolean
isPinned()

Implements net.sf.ehcache.management.sampled.CacheSampler.isPinned.

Configuration property accessor.
public boolean
isTerracottaClustered()

Implements net.sf.ehcache.management.sampled.CacheSampler.isTerracottaClustered.

Is the cache configured with Terracotta clustering?.
public void
propertyChange(PropertyChangeEvent
A PropertyChangeEvent object describing the event source and the property that has changed.
evt
)

Implements java.beans.PropertyChangeListener.propertyChange.

This method gets called when a bound property is changed.
public void
public void
setDiskExpiryThreadIntervalSeconds(long
the new disk expiry thread interval seconds
seconds
)

Implements net.sf.ehcache.management.sampled.CacheSampler.setDiskExpiryThreadIntervalSeconds.

setDiskExpiryThreadIntervalSeconds.
public void
setDiskPersistent(boolean
the new disk persistent
diskPersistent
)

Implements net.sf.ehcache.management.sampled.CacheSampler.setDiskPersistent.

setDiskPersistent.
public void
setEnabled(boolean
the new enabled
enabled
)

Implements net.sf.ehcache.management.sampled.CacheSampler.setEnabled.

Enabled/disable the cache.
public void
setEternal(boolean
the new eternal
eternal
)

Implements net.sf.ehcache.management.sampled.CacheSampler.setEternal.

setEternal.
public void
setLoggingEnabled(boolean
the new logging enabled
enabled
)

Implements net.sf.ehcache.management.sampled.CacheSampler.setLoggingEnabled.

setLoggingEnabled.
public void
setMaxBytesLocalDisk(long
the new max bytes local disk
maxBytes
)

Implements net.sf.ehcache.management.sampled.CacheSampler.setMaxBytesLocalDisk.

setMaxBytesLocalDisk.
public void
setMaxBytesLocalDiskAsString(String
the new max bytes local disk as string
maxBytes
)

Implements net.sf.ehcache.management.sampled.CacheSampler.setMaxBytesLocalDiskAsString.

setMaxBytesLocalDisk.
public void
setMaxBytesLocalHeap(long
the new max bytes local heap
maxBytes
)

Implements net.sf.ehcache.management.sampled.CacheSampler.setMaxBytesLocalHeap.

setMaxBytesLocalHeap.
public void
setMaxBytesLocalHeapAsString(String
the new max bytes local heap as string
maxBytes
)

Implements net.sf.ehcache.management.sampled.CacheSampler.setMaxBytesLocalHeapAsString.

setMaxBytesLocalHeap.
public void
public void
setMaxElementsOnDisk(int
the new max elements on disk
maxElements
)

Implements net.sf.ehcache.management.sampled.CacheSampler.setMaxElementsOnDisk.

setMaxElementsOnDisk.
public void
setMaxEntriesInCache(long
the new max entries in cache
maxEntries
)

Implements net.sf.ehcache.management.sampled.CacheSampler.setMaxEntriesInCache.

setMaxEntriesInCache.
public void
setMaxEntriesLocalDisk(long
the new max entries local disk
maxEntries
)

Implements net.sf.ehcache.management.sampled.CacheSampler.setMaxEntriesLocalDisk.

setMaxEntriesLocalDisk.
public void
setMaxEntriesLocalHeap(long
the new max entries local heap
maxEntries
)

Implements net.sf.ehcache.management.sampled.CacheSampler.setMaxEntriesLocalHeap.

setMaxEntriesLocalHeap.
public void
setMemoryStoreEvictionPolicy(String
the new memory store eviction policy
evictionPolicy
)

Implements net.sf.ehcache.management.sampled.CacheSampler.setMemoryStoreEvictionPolicy.

setMemoryStoreEvictionPolicy.
public void
setNodeBulkLoadEnabled(boolean
the new node bulk load enabled
bulkLoadEnabled
)

Implements net.sf.ehcache.management.sampled.CacheSampler.setNodeBulkLoadEnabled.

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

Implements net.sf.ehcache.management.sampled.SampledCacheMBean.setNodeCoherent.

Deprecated use setNodeBulkLoadEnabled(boolean) instead
Enabled/disable cache coherence mode for this node.
public void
setOverflowToDisk(boolean
the new overflow to disk
overflowToDisk
)

Implements net.sf.ehcache.management.sampled.CacheSampler.setOverflowToDisk.

setOverflowToDisk.
public void
setTimeToIdleSeconds(long
the new time to idle seconds
tti
)

Implements net.sf.ehcache.management.sampled.CacheSampler.setTimeToIdleSeconds.

setTimeToIdleSeconds.
public void
setTimeToLiveSeconds(long
the new time to live seconds
ttl
)

Implements net.sf.ehcache.management.sampled.CacheSampler.setTimeToLiveSeconds.

setTimeToLiveSeconds.
Inherited from net.sf.ehcache.hibernate.management.impl.BaseEmitterBean:
addNotificationListenerdisposeremoveNotificationListenerremoveNotificationListenersendNotificationsendNotificationsendNotification