ehcache

net.sf.ehcache.management.sampled
Interface SampledCacheMBean

All Superinterfaces:
LiveCacheStatistics, SampledCacheStatistics
All Known Implementing Classes:
SampledCache

public interface SampledCacheMBean
extends LiveCacheStatistics, SampledCacheStatistics

An MBean for Cache exposing cache statistics. Extends from both LiveCacheStatistics and SampledCacheStatistics

Since:
1.7
Author:
Abhishek Sanoujam

Field Summary
static java.lang.String CACHE_CHANGED
          CACHE_CHANGED
static java.lang.String CACHE_CLEARED
          CACHE_CLEARED
static java.lang.String CACHE_ENABLED
          CACHE_ENABLED
static java.lang.String CACHE_FLUSHED
          CACHE_FLUSHED
static java.lang.String CACHE_STATISTICS_ENABLED
          CACHE_STATISTICS_ENABLED
static java.lang.String CACHE_STATISTICS_RESET
          CACHE_STATISTICS_RESET
 
Method Summary
 void clearStatistics()
          Clear both sampled and cumulative statistics
 void disableSampledStatistics()
          Disables statistics collection
 void disableStatistics()
          Disables statistics collection.
 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.
 long getConfigDiskExpiryThreadIntervalSeconds()
          Configuration property accessor
 int getConfigMaxElementsInMemory()
          Configuration property accessor
 int getConfigMaxElementsOnDisk()
          Configuration property accessor
 java.lang.String getConfigMemoryStoreEvictionPolicy()
          Configuration property accessor
 long getConfigTimeToIdleSeconds()
          Configuration property accessor
 long getConfigTimeToLiveSeconds()
          Configuration property accessor
 java.lang.String getStatus()
          Gets the status attribute of the Cache.
 boolean isClusterCoherent()
          Is the cache coherent cluster-wide?
 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 isNodeCoherent()
          Is the cache coherent locally?
 boolean isTerracottaClustered()
          Is the cache configured with Terracotta clustering?
 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(java.lang.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 setNodeCoherent(boolean coherent)
          Enabled/disable cache coherence mode for this node.
 
Methods inherited from interface net.sf.ehcache.statistics.LiveCacheStatistics
getAverageGetTimeMillis, getCacheHitCount, getCacheMissCount, getCacheMissCountExpired, getCacheName, getEvictedCount, getExpiredCount, getInMemoryHitCount, getInMemorySize, getMaxGetTimeMillis, getMinGetTimeMillis, getOnDiskHitCount, getOnDiskSize, getPutCount, getRemovedCount, getSize, getStatisticsAccuracy, getStatisticsAccuracyDescription, getUpdateCount, isStatisticsEnabled
 
Methods inherited from interface net.sf.ehcache.statistics.sampled.SampledCacheStatistics
dispose, getAverageGetTimeMostRecentSample, getCacheElementEvictedMostRecentSample, getCacheElementExpiredMostRecentSample, getCacheElementPutMostRecentSample, getCacheElementRemovedMostRecentSample, getCacheElementUpdatedMostRecentSample, getCacheHitInMemoryMostRecentSample, getCacheHitMostRecentSample, getCacheHitOnDiskMostRecentSample, getCacheMissExpiredMostRecentSample, getCacheMissMostRecentSample, getCacheMissNotFoundMostRecentSample, getStatisticsAccuracy, getStatisticsAccuracyDescription, isSampledStatisticsEnabled
 

Field Detail

CACHE_ENABLED

static final java.lang.String CACHE_ENABLED
CACHE_ENABLED

See Also:
Constant Field Values

CACHE_CHANGED

static final java.lang.String CACHE_CHANGED
CACHE_CHANGED

See Also:
Constant Field Values

CACHE_FLUSHED

static final java.lang.String CACHE_FLUSHED
CACHE_FLUSHED

See Also:
Constant Field Values

CACHE_CLEARED

static final java.lang.String CACHE_CLEARED
CACHE_CLEARED

See Also:
Constant Field Values

CACHE_STATISTICS_ENABLED

static final java.lang.String CACHE_STATISTICS_ENABLED
CACHE_STATISTICS_ENABLED

See Also:
Constant Field Values

CACHE_STATISTICS_RESET

static final java.lang.String CACHE_STATISTICS_RESET
CACHE_STATISTICS_RESET

See Also:
Constant Field Values
Method Detail

isEnabled

boolean isEnabled()
Is the cache enabled?


setNodeCoherent

void setNodeCoherent(boolean coherent)
Enabled/disable cache coherence mode for this node.


isClusterCoherent

boolean isClusterCoherent()
Is the cache coherent cluster-wide?


isNodeCoherent

boolean isNodeCoherent()
Is the cache coherent locally?


setEnabled

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


removeAll

void removeAll()
Removes all cached items.


flush

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


getStatus

java.lang.String getStatus()
Gets the status attribute of the Cache.

Returns:
The status value from the Status enum class

isTerracottaClustered

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

Returns:
true if clustered with terracotta

clearStatistics

void clearStatistics()
Clear both sampled and cumulative statistics

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

enableStatistics

void enableStatistics()
Enables statistics collection


disableStatistics

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


enableSampledStatistics

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


disableSampledStatistics

void disableSampledStatistics()
Disables statistics collection


getConfigMaxElementsInMemory

int getConfigMaxElementsInMemory()
Configuration property accessor

Returns:
Max elements in memory config setting value

setConfigMaxElementsInMemory

void setConfigMaxElementsInMemory(int maxElements)
setConfigMaxElementsInMemory

Parameters:
maxElements -

getConfigMaxElementsOnDisk

int getConfigMaxElementsOnDisk()
Configuration property accessor

Returns:
Max elements on disk config setting value

setConfigMaxElementsOnDisk

void setConfigMaxElementsOnDisk(int maxElements)
setConfigMaxElementsOnDisk

Parameters:
maxElements -

getConfigMemoryStoreEvictionPolicy

java.lang.String getConfigMemoryStoreEvictionPolicy()
Configuration property accessor

Returns:
a String representation of the policy

setConfigMemoryStoreEvictionPolicy

void setConfigMemoryStoreEvictionPolicy(java.lang.String evictionPolicy)
setConfigMemoryStoreEvictionPolicy

Parameters:
evictionPolicy -

isConfigEternal

boolean isConfigEternal()
Configuration property accessor

Returns:
true if set to eternal in config

setConfigEternal

void setConfigEternal(boolean eternal)
setConfigEternal

Parameters:
eternal -

getConfigTimeToIdleSeconds

long getConfigTimeToIdleSeconds()
Configuration property accessor

Returns:
TTI in config

setConfigTimeToIdleSeconds

void setConfigTimeToIdleSeconds(long tti)
setConfigTimeToIdleSeconds

Parameters:
tti -

getConfigTimeToLiveSeconds

long getConfigTimeToLiveSeconds()
Configuration property accessor

Returns:
TTL in config

setConfigTimeToLiveSeconds

void setConfigTimeToLiveSeconds(long ttl)
setConfigTimeToLiveSeconds

Parameters:
ttl -

isConfigOverflowToDisk

boolean isConfigOverflowToDisk()
Configuration property accessor

Returns:
true if overflow to disk specified in config

setConfigOverflowToDisk

void setConfigOverflowToDisk(boolean overflowToDisk)
setConfigOverflowToDisk

Parameters:
overflowToDisk -

isConfigDiskPersistent

boolean isConfigDiskPersistent()
Configuration property accessor

Returns:
true if configured with disk persistence

setConfigDiskPersistent

void setConfigDiskPersistent(boolean diskPersistent)
setConfigDiskPersistent

Parameters:
diskPersistent -

getConfigDiskExpiryThreadIntervalSeconds

long getConfigDiskExpiryThreadIntervalSeconds()
Configuration property accessor

Returns:
Value for disk expiry thread interval in seconds specified in config

setConfigDiskExpiryThreadIntervalSeconds

void setConfigDiskExpiryThreadIntervalSeconds(long seconds)
setConfigDiskExpiryThreadIntervalSeconds

Parameters:
seconds -

isConfigLoggingEnabled

boolean isConfigLoggingEnabled()
Configuration property accessor

Returns:
true if logging is enabled on the cache

setConfigLoggingEnabled

void setConfigLoggingEnabled(boolean enabled)
setConfigLoggingEnabled

Parameters:
enabled -

ehcache

true