ehcache

net.sf.ehcache.management
Class CacheManager

java.lang.Object
  extended by net.sf.ehcache.management.CacheManager
All Implemented Interfaces:
CacheManagerMBean

public class CacheManager
extends 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: CacheManager.java 5594 2012-05-07 16:04:31Z cdennis $
Author:
Greg Luck

Constructor Summary
CacheManager(CacheManager cacheManager)
          Create a management CacheManager
 
Method Summary
 void clearAll()
          Clears the contents of all caches in the CacheManager, but without removing any caches.
 Cache getCache(String name)
          Returns a JMX Cache bean
 String[] getCacheNames()
          Gets the cache names managed by the CacheManager
 List getCaches()
          Gets a list of caches in this CacheManager
 String getName()
          Gets the name of the CacheManager
 String getStatus()
          Gets the status attribute of the Ehcache
 long getTransactionCommittedCount()
          Get the committed transactions count
 long getTransactionRolledBackCount()
          Get the rolled back transactions count
 long getTransactionTimedOutCount()
          Get the timed out transactions count.
 void shutdown()
          Shuts down the CacheManager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheManager

public CacheManager(CacheManager cacheManager)
             throws CacheException
Create a management CacheManager

Parameters:
cacheManager -
Throws:
CacheException
Method Detail

getStatus

public String getStatus()
Gets the status attribute of the Ehcache

Specified by:
getStatus in interface CacheManagerMBean
Returns:
The status value, as a String from the Status enum class

getName

public String getName()
Gets the name of the CacheManager

Specified by:
getName in interface CacheManagerMBean
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:
shutdown in interface CacheManagerMBean

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:
clearAll in interface CacheManagerMBean

getCache

public Cache getCache(String name)
Returns a JMX Cache bean

Specified by:
getCache in interface CacheManagerMBean

getCacheNames

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

Specified by:
getCacheNames in interface CacheManagerMBean
Throws:
IllegalStateException

getCaches

public List getCaches()
Gets a list of caches in this CacheManager

Specified by:
getCaches in interface CacheManagerMBean
Returns:
a list of JMX Cache objects

getTransactionCommittedCount

public long getTransactionCommittedCount()
Get the committed transactions count

Specified by:
getTransactionCommittedCount in interface CacheManagerMBean
Returns:
the committed transactions count

getTransactionRolledBackCount

public long getTransactionRolledBackCount()
Get the rolled back transactions count

Specified by:
getTransactionRolledBackCount in interface CacheManagerMBean
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:
getTransactionTimedOutCount in interface CacheManagerMBean
Returns:
the timed out transactions count

ehcache

Copyright 2001-2014, Terracotta, Inc.