Top Description Fields Constructors Methods
net.sf.ehcache.management

public Class CacheManager

extends Object
implements CacheManagerMBean
Class Inheritance
All Implemented Interfaces
net.sf.ehcache.management.CacheManagerMBean
Imports
net.sf.ehcache.CacheException, net.sf.ehcache.hibernate.management.impl.EhcacheHibernateMbeanNames, javax.management.MalformedObjectNameException, .ObjectName, java.util.ArrayList, .List

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.
Author
Greg Luck
Since
1.3
Version
$Id: CacheManager.java 10789 2018-04-26 02:08:13Z adahanne $

Field Summary

Modifier and TypeField and Description
private CacheManager
private ObjectName

Constructor Summary

AccessConstructor and Description
public
CacheManager(CacheManager cacheManager)

Create a management CacheManager

Method Summary

Modifier and TypeMethod and Description
public void
clearAll()

Implements net.sf.ehcache.management.CacheManagerMBean.clearAll.

Clears the contents of all caches in the CacheManager, but without removing any caches.
pack-priv static ObjectName
createObjectName(CacheManager cacheManager)

Creates an object name using the scheme "net.sf.ehcache:type=CacheManager,name=<cachemanagername>"

public Cache
getCache(String name)

Implements net.sf.ehcache.management.CacheManagerMBean.getCache.

Returns a JMX Cache bean
public String[]
getCacheNames()

Implements net.sf.ehcache.management.CacheManagerMBean.getCacheNames.

Gets the cache names managed by the CacheManager
public List<E>

Returns:

a list of JMX Cache objects
getCaches
()

Implements net.sf.ehcache.management.CacheManagerMBean.getCaches.

Gets a list of caches in this CacheManager
public String

Returns:

The cache manager name, which may not be set
getName
()

Implements net.sf.ehcache.management.CacheManagerMBean.getName.

Gets the name of the CacheManager
pack-priv ObjectName

Returns:

the object name for this MBean
getObjectName
()

public String

Returns:

The status value, as a String from the Status enum class
getStatus
()

Implements net.sf.ehcache.management.CacheManagerMBean.getStatus.

Gets the status attribute of the Ehcache
public long
public long
public long
public void
shutdown()

Implements net.sf.ehcache.management.CacheManagerMBean.shutdown.

Shuts down the CacheManager.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cacheManagerback to summary
private CacheManager cacheManager
objectNameback to summary
private ObjectName objectName

Constructor Detail

CacheManagerback to summary
public CacheManager(CacheManager cacheManager) throws CacheException

Create a management CacheManager

Method Detail

clearAllback to summary
public void clearAll()

Implements net.sf.ehcache.management.CacheManagerMBean.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 net.sf.ehcache.Ehcache#removeAll() mehod on each cache is called.

createObjectNameback to summary
pack-priv static ObjectName createObjectName(CacheManager cacheManager)

Creates an object name using the scheme "net.sf.ehcache:type=CacheManager,name="

getCacheback to summary
public Cache getCache(String name)

Implements net.sf.ehcache.management.CacheManagerMBean.getCache.

Returns a JMX Cache bean

getCacheNamesback to summary
public String[] getCacheNames() throws IllegalStateException

Implements net.sf.ehcache.management.CacheManagerMBean.getCacheNames.

Gets the cache names managed by the CacheManager

getCachesback to summary
public List<E> getCaches()

Implements net.sf.ehcache.management.CacheManagerMBean.getCaches.

Gets a list of caches in this CacheManager

Returns:List<E>

a list of JMX Cache objects

getNameback to summary
public String getName()

Implements net.sf.ehcache.management.CacheManagerMBean.getName.

Gets the name of the CacheManager

Returns:String

The cache manager name, which may not be set

getObjectNameback to summary
pack-priv ObjectName getObjectName()
Returns:ObjectName

the object name for this MBean

getStatusback to summary
public String getStatus()

Implements net.sf.ehcache.management.CacheManagerMBean.getStatus.

Gets the status attribute of the Ehcache

Returns:String

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

getTransactionCommittedCountback to summary
public long getTransactionCommittedCount()

Implements net.sf.ehcache.management.CacheManagerMBean.getTransactionCommittedCount.

Doc from net.sf.ehcache.management.CacheManagerMBean.getTransactionCommittedCount.

Get the committed transactions count

Returns:long

the committed transactions count

getTransactionRolledBackCountback to summary
public long getTransactionRolledBackCount()

Implements net.sf.ehcache.management.CacheManagerMBean.getTransactionRolledBackCount.

Doc from net.sf.ehcache.management.CacheManagerMBean.getTransactionRolledBackCount.

Get the rolled back transactions count

Returns:long

the rolled back transactions count

getTransactionTimedOutCountback to summary
public long getTransactionTimedOutCount()

Implements net.sf.ehcache.management.CacheManagerMBean.getTransactionTimedOutCount.

Doc from net.sf.ehcache.management.CacheManagerMBean.getTransactionTimedOutCount.

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

Returns:long

the timed out transactions count

shutdownback to summary
public void shutdown()

Implements net.sf.ehcache.management.CacheManagerMBean.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.