Interface CacheMXBean
-
@MXBean public interface CacheMXBean
A management bean for cache. It provides configuration information. It does not allow mutation of configuration or mutation of the cache.Each cache's management object must be registered with an ObjectName that is unique and has the following type and attributes:
Type:
javax.cache:type=CacheConfiguration
Required Attributes:
- CacheManager the URI of the CacheManager
- Cache the name of the Cache
- Since:
- 1.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String
getKeyType()
Determines the required type of keys for thisCache
, if any.java.lang.String
getValueType()
Determines the required type of values for thisCache
, if any.boolean
isManagementEnabled()
Checks whether management is enabled on this cache.boolean
isReadThrough()
Determines if aCache
should operate in read-through mode.boolean
isStatisticsEnabled()
Checks whether statistics collection is enabled in this cache.boolean
isStoreByValue()
Whether storeByValue (true) or storeByReference (false).boolean
isWriteThrough()
Determines if aCache
should operate in "write-through" mode.
-
-
-
Method Detail
-
getKeyType
java.lang.String getKeyType()
Determines the required type of keys for thisCache
, if any.- Returns:
- the fully qualified class name of the key type, or "java.lang.Object" if the type is undefined.
-
getValueType
java.lang.String getValueType()
Determines the required type of values for thisCache
, if any.- Returns:
- the fully qualified class name of the value type, or "java.lang.Object" if the type is undefined.
-
isReadThrough
boolean isReadThrough()
Determines if aCache
should operate in read-through mode.When in read-through mode, cache misses that occur due to cache entries not existing as a result of performing a "get" call via one of
Cache.get(K)
,Cache.getAll(java.util.Set<? extends K>)
,Cache.getAndRemove(K)
and/orCache.getAndReplace(K, V)
will appropriately cause the configuredCacheLoader
to be invoked.The default value is
false
.- Returns:
true
when aCache
is in "read-through" mode.- See Also:
CacheLoader
-
isWriteThrough
boolean isWriteThrough()
Determines if aCache
should operate in "write-through" mode.When in "write-through" mode, cache updates that occur as a result of performing "put" operations called via one of
Cache.put(K, V)
,Cache.getAndRemove(K)
,Cache.removeAll(java.util.Set<? extends K>)
,Cache.getAndPut(K, V)
Cache.getAndRemove(K)
,Cache.getAndReplace(K, V)
,Cache.invoke(K, javax.cache.processor.EntryProcessor<K, V, T>, java.lang.Object...)
Cache.invokeAll(java.util.Set<? extends K>, javax.cache.processor.EntryProcessor<K, V, T>, java.lang.Object...)
will appropriately cause the configured
CacheWriter
to be invoked.The default value is
false
.- Returns:
true
when aCache
is in "write-through" mode.- See Also:
CacheWriter
-
isStoreByValue
boolean isStoreByValue()
Whether storeByValue (true) or storeByReference (false). When true, both keys and values are stored by value.When false, both keys and values are stored by reference. Caches stored by reference are capable of mutation by any threads holding the reference. The effects are:
- if the key is mutated, then the key may not be retrievable or removable
- if the value is mutated, then all threads in the JVM can potentially observe those mutations, subject to the normal Java Memory Model rules.
When a cache is storeByValue, any mutation to the key or value does not affect the key of value stored in the cache.
The default value is
true
.- Returns:
- true if the cache is store by value
-
isStatisticsEnabled
boolean isStatisticsEnabled()
Checks whether statistics collection is enabled in this cache.The default value is
false
.- Returns:
- true if statistics collection is enabled
-
isManagementEnabled
boolean isManagementEnabled()
Checks whether management is enabled on this cache.The default value is
false
.- Returns:
- true if management is enabled
-
-