ehcache

net.sf.ehcache.management.sampled
Interface SampledCacheManagerMBean

All Known Implementing Classes:
SampledCacheManager

public interface SampledCacheManagerMBean

An MBean for CacheManager exposing sampled cache usage statistics

Since:
1.7
Author:
Abhishek Sanoujam

Field Summary
static String CACHES_CLEARED
          CACHES_CLEARED
static String CACHES_ENABLED
          CACHES_ENABLED
static String STATISTICS_ENABLED
          STATISTICS_ENABLED
static String STATISTICS_RESET
          STATISTICS_RESET
 
Method Summary
 void clearAll()
          Clears the contents of all caches in the CacheManager, but without removing any caches.
 void clearStatistics()
          Clears statistics of all caches for the associated cacheManager
 void disableStatistics()
          Disable statistics for each cache contained by cacheManager
 void enableStatistics()
          Enable statistics for each cache contained by cacheManager
 String generateActiveConfigDeclaration()
          generateActiveConfigDeclaration
 String generateActiveConfigDeclaration(String cacheName)
          generateActiveConfigDeclaration
 long getCacheAverageSearchTime()
           
 long getCacheEvictionRate()
           
 long getCacheExpirationRate()
           
 long getCacheHitRate()
           
 Map<String,long[]> getCacheMetrics()
          Get a map of cache name to performance metrics (hits, misses).
 long getCacheMissRate()
           
 String[] getCacheNames()
          Gets the cache names managed by the CacheManager
 long getCachePutRate()
           
 long getCacheSearchRate()
           
 long getCacheUpdateRate()
           
 boolean getHasWriteBehindWriter()
          Returns whether any caches are configured for write-behind
 String getMBeanRegisteredName()
          Gets the name used to register this mbean.
 String getName()
          Gets the actual name of the cache manager.
 boolean getSearchable()
           
 String getStatus()
          Gets the status attribute of the Ehcache
 boolean getTransactional()
          Are any of the caches transactional
 long getTransactionCommitRate()
           
 long getTransactionCommittedCount()
          Get the committed transactions count
 long getTransactionRollbackRate()
           
 long getTransactionRolledBackCount()
          Get the rolled back transactions count
 long getTransactionTimedOutCount()
          Get the timed out transactions count.
 int getWriterMaxQueueSize()
          Maximum elements that can be queued for processing by the write-behind writer
 long getWriterQueueLength()
          Returns the total length of all write-behind queues across all caches
 boolean isEnabled()
          Returns if each cache is enabled.
 boolean isStatisticsEnabled()
          Returns true iff each contained cache has statistics enabled
 void setEnabled(boolean enabled)
          Enables/disables each cache contained by this CacheManager
 void setStatisticsEnabled(boolean enabled)
          Enables/disables each contained cache
 void shutdown()
          Shuts down the CacheManager.
 

Field Detail

CACHES_ENABLED

static final String CACHES_ENABLED
CACHES_ENABLED

See Also:
Constant Field Values

CACHES_CLEARED

static final String CACHES_CLEARED
CACHES_CLEARED

See Also:
Constant Field Values

STATISTICS_RESET

static final String STATISTICS_RESET
STATISTICS_RESET

See Also:
Constant Field Values

STATISTICS_ENABLED

static final String STATISTICS_ENABLED
STATISTICS_ENABLED

See Also:
Constant Field Values
Method Detail

getName

String getName()
Gets the actual name of the cache manager. This may be different from the name used to register this mbean as there can potentially be multiple cache managers with same name


getMBeanRegisteredName

String getMBeanRegisteredName()
Gets the name used to register this mbean.


getStatus

String getStatus()
Gets the status attribute of the Ehcache

Returns:
The status value, as a String from the Status enum class

setEnabled

void setEnabled(boolean enabled)
Enables/disables each cache contained by this CacheManager

Parameters:
enabled -

isEnabled

boolean isEnabled()
Returns if each cache is enabled.

Returns:
boolean indicating that each cache is enabled

shutdown

void shutdown()
Shuts down the CacheManager.

If the shutdown occurs on the singleton, then the singleton is removed, so that if a singleton access method is called, a new singleton will be created.


clearAll

void clearAll()
Clears the contents of all caches in the CacheManager, but without removing any caches.

This method is not synchronized. It only guarantees to clear those elements in a cache at the time that the Ehcache.removeAll() mehod on each cache is called.


getCacheNames

String[] getCacheNames()
                       throws IllegalStateException
Gets the cache names managed by the CacheManager

Throws:
IllegalStateException

getCacheMetrics

Map<String,long[]> getCacheMetrics()
Get a map of cache name to performance metrics (hits, misses).

Returns:
a map of cache metrics

getCacheHitRate

long getCacheHitRate()
Returns:
aggregate hit rate

getCacheMissRate

long getCacheMissRate()
Returns:
aggregate miss rate

getCachePutRate

long getCachePutRate()
Returns:
aggregate put rate

getCacheUpdateRate

long getCacheUpdateRate()
Returns:
aggregate update rate

getCacheEvictionRate

long getCacheEvictionRate()
Returns:
aggregate eviction rate

getCacheExpirationRate

long getCacheExpirationRate()
Returns:
aggregate expiration rate

getSearchable

boolean getSearchable()
Returns:
if any contained caches are configured for search

getCacheSearchRate

long getCacheSearchRate()
Returns:
aggregate search rate

getCacheAverageSearchTime

long getCacheAverageSearchTime()
Returns:
aggregate search time

clearStatistics

void clearStatistics()
Clears statistics of all caches for the associated cacheManager


enableStatistics

void enableStatistics()
Enable statistics for each cache contained by cacheManager


disableStatistics

void disableStatistics()
Disable statistics for each cache contained by cacheManager


setStatisticsEnabled

void setStatisticsEnabled(boolean enabled)
Enables/disables each contained cache


isStatisticsEnabled

boolean isStatisticsEnabled()
Returns true iff each contained cache has statistics enabled


generateActiveConfigDeclaration

String generateActiveConfigDeclaration()
generateActiveConfigDeclaration

Returns:
CacheManager configuration as String

generateActiveConfigDeclaration

String generateActiveConfigDeclaration(String cacheName)
generateActiveConfigDeclaration

Parameters:
cacheName -
Returns:
Cache configuration as String

getTransactional

boolean getTransactional()
Are any of the caches transactional

See Also:
CacheConfiguration.TransactionalMode

getTransactionCommittedCount

long getTransactionCommittedCount()
Get the committed transactions count

Returns:
the committed transactions count

getTransactionCommitRate

long getTransactionCommitRate()
Returns:
aggregate Xa commit rate

getTransactionRolledBackCount

long getTransactionRolledBackCount()
Get the rolled back transactions count

Returns:
the rolled back transactions count

getTransactionRollbackRate

long getTransactionRollbackRate()
Returns:
aggregate Xa rollback rate

getTransactionTimedOutCount

long getTransactionTimedOutCount()
Get the timed out transactions count. Note that only transactions which failed to commit due to a timeout are taken into account

Returns:
the timed out transactions count

getHasWriteBehindWriter

boolean getHasWriteBehindWriter()
Returns whether any caches are configured for write-behind


getWriterQueueLength

long getWriterQueueLength()
Returns the total length of all write-behind queues across all caches

Returns:
aggregate writer-behind queue length

getWriterMaxQueueSize

int getWriterMaxQueueSize()
Maximum elements that can be queued for processing by the write-behind writer

Returns:
aggregate of the maximum elements that can be waiting to be processed by the write-behind writer across all caches

ehcache

true