Package net.sf.ehcache.management
Class CacheManager
- java.lang.Object
-
- net.sf.ehcache.management.CacheManager
-
- All Implemented Interfaces:
CacheManagerMBean
public class CacheManager extends java.lang.Object implements CacheManagerMBean
An MBean implementation for those attributes and operations we wish to expose on net.sf.ehcache.CacheManager. This class is not Serializable because it is an adapter around a net.sf.ehcache.CacheManager, which is itself not Serializable.- Since:
- 1.3
- Version:
- $Id$
- Author:
- Greg Luck
-
-
Constructor Summary
Constructors Constructor Description CacheManager(CacheManager cacheManager)Create a management CacheManager
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearAll()Clears the contents of all caches in the CacheManager, but without removing any caches.CachegetCache(java.lang.String name)Returns a JMX Cache beanjava.lang.String[]getCacheNames()Gets the cache names managed by the CacheManagerjava.util.ListgetCaches()Gets a list of caches in this CacheManagerjava.lang.StringgetName()Gets the name of the CacheManagerjava.lang.StringgetStatus()Gets the status attribute of the EhcachelonggetTransactionCommittedCount()Get the committed transactions countlonggetTransactionRolledBackCount()Get the rolled back transactions countlonggetTransactionTimedOutCount()Get the timed out transactions count.voidshutdown()Shuts down the CacheManager.
-
-
-
Constructor Detail
-
CacheManager
public CacheManager(CacheManager cacheManager) throws CacheException
Create a management CacheManager- Parameters:
cacheManager-- Throws:
CacheException
-
-
Method Detail
-
getStatus
public java.lang.String getStatus()
Gets the status attribute of the Ehcache- Specified by:
getStatusin interfaceCacheManagerMBean- Returns:
- The status value, as a String from the Status enum class
-
getName
public java.lang.String getName()
Gets the name of the CacheManager- Specified by:
getNamein interfaceCacheManagerMBean- Returns:
- The cache manager name, which may not be set
-
shutdown
public 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.
- Specified by:
shutdownin interfaceCacheManagerMBean
-
clearAll
public 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.- Specified by:
clearAllin interfaceCacheManagerMBean
-
getCache
public Cache getCache(java.lang.String name)
Returns a JMX Cache bean- Specified by:
getCachein interfaceCacheManagerMBean
-
getCacheNames
public java.lang.String[] getCacheNames() throws java.lang.IllegalStateExceptionGets the cache names managed by the CacheManager- Specified by:
getCacheNamesin interfaceCacheManagerMBean- Throws:
java.lang.IllegalStateException
-
getCaches
public java.util.List getCaches()
Gets a list of caches in this CacheManager- Specified by:
getCachesin interfaceCacheManagerMBean- Returns:
- a list of JMX Cache objects
-
getTransactionCommittedCount
public long getTransactionCommittedCount()
Get the committed transactions count- Specified by:
getTransactionCommittedCountin interfaceCacheManagerMBean- Returns:
- the committed transactions count
-
getTransactionRolledBackCount
public long getTransactionRolledBackCount()
Get the rolled back transactions count- Specified by:
getTransactionRolledBackCountin interfaceCacheManagerMBean- Returns:
- the rolled back transactions count
-
getTransactionTimedOutCount
public long getTransactionTimedOutCount()
Get the timed out transactions count. Note that only transactions which failed to commit due to a timeout are taken into account- Specified by:
getTransactionTimedOutCountin interfaceCacheManagerMBean- Returns:
- the timed out transactions count
-
-