public class Cache extends java.lang.Object implements CacheMBean, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
private Ehcache |
cache
An Ehcache backing instance
|
private javax.management.ObjectName |
objectName |
private static long |
serialVersionUID |
Constructor and Description |
---|
Cache(Ehcache cache)
A constructor for JCache.
|
Modifier and Type | Method and Description |
---|---|
(package private) static javax.management.ObjectName |
createObjectName(java.lang.String cacheManagerName,
java.lang.String cacheName)
Creates an object name using the scheme "net.sf.ehcache:type=Cache,CacheManager=
|
void |
flush()
Flushes all cache items from memory to the disk store, and from the DiskStore to disk.
|
CacheConfiguration |
getCacheConfiguration()
Gets the JMX read-only CacheConfiguration
|
java.lang.String |
getName()
Gets the cache name.
|
(package private) javax.management.ObjectName |
getObjectName() |
CacheStatistics |
getStatistics()
Gets the JMX cache statistics
|
java.lang.String |
getStatus()
Gets the status attribute of the Cache.
|
(package private) Store |
getStore()
Gets the JMX store bean
|
boolean |
hasAbortedSizeOf()
May the cache contain elements which the SizeOf engine could not fully size?
|
boolean |
isTerracottaClustered()
Is the cache configured with Terracotta clustering?
|
void |
removeAll()
Removes all cached items.
|
private static final long serialVersionUID
private transient Ehcache cache
private javax.management.ObjectName objectName
public Cache(Ehcache cache) throws CacheException
ConfigurationFactory
and clients can create these.
A client can specify their own settings here and pass the Ehcache
object
into CacheManager.addCache(java.lang.String)
to specify parameters other than the defaults.
Only the CacheManager can initialise them.cache
- An ehcacheCacheException
static javax.management.ObjectName createObjectName(java.lang.String cacheManagerName, java.lang.String cacheName)
public void removeAll() throws java.lang.IllegalStateException, CacheException
removeAll
in interface CacheMBean
java.lang.IllegalStateException
- if the cache is not Status.STATUS_ALIVE
CacheException
public void flush() throws java.lang.IllegalStateException, CacheException
flush
in interface CacheMBean
java.lang.IllegalStateException
- if the cache is not Status.STATUS_ALIVE
CacheException
public java.lang.String getStatus()
getStatus
in interface CacheMBean
public java.lang.String getName()
getName
in interface CacheMBean
public boolean isTerracottaClustered()
isTerracottaClustered
in interface CacheMBean
public boolean hasAbortedSizeOf()
hasAbortedSizeOf
in interface CacheMBean
public CacheConfiguration getCacheConfiguration()
getCacheConfiguration
in interface CacheMBean
public CacheStatistics getStatistics()
getStatistics
in interface CacheMBean
Store getStore() throws javax.management.NotCompliantMBeanException
javax.management.NotCompliantMBeanException
javax.management.ObjectName getObjectName()