Package net.sf.ehcache.management
Class Cache
- java.lang.Object
-
- net.sf.ehcache.management.Cache
-
- All Implemented Interfaces:
java.io.Serializable,CacheMBean
public class Cache extends java.lang.Object implements CacheMBean, java.io.Serializable
A Cache implementation that supports JMX MBeans- Since:
- 1.3
- Version:
- $Id$
- Author:
- Greg Luck
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidflush()Flushes all cache items from memory to the disk store, and from the DiskStore to disk.CacheConfigurationgetCacheConfiguration()Gets the JMX read-only CacheConfigurationjava.lang.StringgetName()Gets the cache name.CacheStatisticsgetStatistics()Gets the JMX cache statisticsjava.lang.StringgetStatus()Gets the status attribute of the Cache.booleanhasAbortedSizeOf()May the cache contain elements which the SizeOf engine could not fully size?booleanisTerracottaClustered()Is the cache configured with Terracotta clustering?voidremoveAll()Removes all cached items.
-
-
-
Constructor Detail
-
Cache
public Cache(Ehcache cache) throws CacheException
A constructor for JCache. JCache is an adaptor for an Ehcache, and therefore requires an Ehcace in its constructor.The
ConfigurationFactoryand clients can create these.A client can specify their own settings here and pass the
Ehcacheobject intoCacheManager.addCache(java.lang.String)to specify parameters other than the defaults.Only the CacheManager can initialise them.
- Parameters:
cache- An ehcache- Throws:
CacheException
-
-
Method Detail
-
removeAll
public void removeAll() throws java.lang.IllegalStateException, CacheExceptionRemoves all cached items.- Specified by:
removeAllin interfaceCacheMBean- Throws:
java.lang.IllegalStateException- if the cache is notStatus.STATUS_ALIVECacheException
-
flush
public void flush() throws java.lang.IllegalStateException, CacheExceptionFlushes all cache items from memory to the disk store, and from the DiskStore to disk.- Specified by:
flushin interfaceCacheMBean- Throws:
java.lang.IllegalStateException- if the cache is notStatus.STATUS_ALIVECacheException
-
getStatus
public java.lang.String getStatus()
Gets the status attribute of the Cache.- Specified by:
getStatusin interfaceCacheMBean- Returns:
- The status value as a String from the Status enum class
-
getName
public java.lang.String getName()
Gets the cache name.- Specified by:
getNamein interfaceCacheMBean
-
isTerracottaClustered
public boolean isTerracottaClustered()
Is the cache configured with Terracotta clustering?- Specified by:
isTerracottaClusteredin interfaceCacheMBean
-
hasAbortedSizeOf
public boolean hasAbortedSizeOf()
May the cache contain elements which the SizeOf engine could not fully size?- Specified by:
hasAbortedSizeOfin interfaceCacheMBean
-
getCacheConfiguration
public CacheConfiguration getCacheConfiguration()
Gets the JMX read-only CacheConfiguration- Specified by:
getCacheConfigurationin interfaceCacheMBean
-
getStatistics
public CacheStatistics getStatistics()
Gets the JMX cache statistics- Specified by:
getStatisticsin interfaceCacheMBean
-
-