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 String CACHE_CHANGED
          CACHE_CHANGED
static String CACHE_CLEARED
          CACHE_CLEARED
static String CACHE_ENABLED
          CACHE_ENABLED
static String CACHE_FLUSHED
          CACHE_FLUSHED
static String CACHE_STATISTICS_ENABLED
          CACHE_STATISTICS_ENABLED
static 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
 String getConfigMemoryStoreEvictionPolicy()
          Configuration property accessor
 long getConfigTimeToIdleSeconds()
          Configuration property accessor
 long getConfigTimeToLiveSeconds()
          Configuration property accessor
 boolean getHasWriteBehindWriter()
          Is there a registered Write-behind CacheWriter
 boolean getSearchable()
          Is the cache configured for search
 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
 int getWriterConcurrency()
          Returns the number of configured write-behind queues/threads.
 int getWriterMaxQueueSize()
          Returns the maximum size of any write-behind queues.
 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 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(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.
 
Methods inherited from interface net.sf.ehcache.statistics.LiveCacheStatistics
getAverageGetTimeMillis, getCacheHitCount, getCacheMissCount, getCacheMissCountExpired, getCacheName, getEvictedCount, getExpiredCount, getInMemoryHitCount, getInMemoryMissCount, getInMemorySize, getMaxGetTimeMillis, getMinGetTimeMillis, getOffHeapHitCount, getOffHeapMissCount, getOffHeapSize, getOnDiskHitCount, getOnDiskMissCount, getOnDiskSize, getPutCount, getRemovedCount, getSize, getStatisticsAccuracy, getStatisticsAccuracyDescription, getUpdateCount, getWriterQueueLength, getXaCommitCount, getXaRollbackCount, isStatisticsEnabled
 
Methods inherited from interface net.sf.ehcache.statistics.sampled.SampledCacheStatistics
dispose, getAverageGetTimeMostRecentSample, getAverageSearchTime, getCacheElementEvictedMostRecentSample, getCacheElementExpiredMostRecentSample, getCacheElementPutMostRecentSample, getCacheElementRemovedMostRecentSample, getCacheElementUpdatedMostRecentSample, getCacheHitInMemoryMostRecentSample, getCacheHitMostRecentSample, getCacheHitOffHeapMostRecentSample, getCacheHitOnDiskMostRecentSample, getCacheMissExpiredMostRecentSample, getCacheMissInMemoryMostRecentSample, getCacheMissMostRecentSample, getCacheMissNotFoundMostRecentSample, getCacheMissOffHeapMostRecentSample, getCacheMissOnDiskMostRecentSample, getCacheXaCommitsMostRecentSample, getCacheXaRollbacksMostRecentSample, getSearchesPerSecond, getStatisticsAccuracy, getStatisticsAccuracyDescription, isSampledStatisticsEnabled
 

Field Detail

CACHE_ENABLED

static final String CACHE_ENABLED
CACHE_ENABLED

See Also:
Constant Field Values

CACHE_CHANGED

static final String CACHE_CHANGED
CACHE_CHANGED

See Also:
Constant Field Values

CACHE_FLUSHED

static final String CACHE_FLUSHED
CACHE_FLUSHED

See Also:
Constant Field Values

CACHE_CLEARED

static final String CACHE_CLEARED
CACHE_CLEARED

See Also:
Constant Field Values

CACHE_STATISTICS_ENABLED

static final String CACHE_STATISTICS_ENABLED
CACHE_STATISTICS_ENABLED

See Also:
Constant Field Values

CACHE_STATISTICS_RESET

static final String CACHE_STATISTICS_RESET
CACHE_STATISTICS_RESET

See Also:
Constant Field Values
Method Detail

isEnabled

boolean isEnabled()
Is the cache enabled?


setNodeCoherent

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

Enabled/disable cache coherence mode for this node.


setNodeBulkLoadEnabled

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


isClusterCoherent

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

Is the cache coherent cluster-wide?


isClusterBulkLoadEnabled

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


isNodeCoherent

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

Is the cache coherent locally?


isNodeBulkLoadEnabled

boolean isNodeBulkLoadEnabled()
Is the cache in bulk-load mode 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

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

getTerracottaConsistency

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

Returns:
"STRONG", "EVENTUAL", or "na" if the cache is not Terracotta-clustered

getTerracottaStorageStrategy

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

Returns:
"CDV2", "CLASSIC", or "na" if the cache is not Terracotta-clustered

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.


setStatisticsEnabled

void setStatisticsEnabled(boolean statsEnabled)
Controls the statistics. Also controls 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

String getConfigMemoryStoreEvictionPolicy()
Configuration property accessor

Returns:
a String representation of the policy

setConfigMemoryStoreEvictionPolicy

void setConfigMemoryStoreEvictionPolicy(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 -

getHasWriteBehindWriter

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


getWriterMaxQueueSize

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

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

getWriterConcurrency

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

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

getTransactional

boolean getTransactional()
Is the cache a transactional one

See Also:
CacheConfiguration.TransactionalMode

getSearchable

boolean getSearchable()
Is the cache configured for search

See Also:
Searchable

ehcache

true