Top Description Methods
javax.cache.management

public Interface CacheMXBean

Annotations
@MXBean
Imports
javax.cache.Cache, javax.cache.integration.CacheLoader, .CacheWriter, javax.management.MXBean

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:

Authors
Greg Luck, Yannis Cosmadopoulos
Since
1.0

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the fully qualified class name of the key type, or "java.lang.Object" if the type is undefined.
getKeyType
()

Determines the required type of keys for this Cache, if any.

public String

Returns:

the fully qualified class name of the value type, or "java.lang.Object" if the type is undefined.
getValueType
()

Determines the required type of values for this Cache, if any.

public boolean

Returns:

true if management is enabled
isManagementEnabled
()

Checks whether management is enabled on this cache.

public boolean

Returns:

true when a Cache is in "read-through" mode.
isReadThrough
()

Determines if a Cache should operate in read-through mode.

public boolean

Returns:

true if statistics collection is enabled
isStatisticsEnabled
()

Checks whether statistics collection is enabled in this cache.

public boolean

Returns:

true if the cache is store by value
isStoreByValue
()

Whether storeByValue (true) or storeByReference (false).

public boolean

Returns:

true when a Cache is in "write-through" mode.
isWriteThrough
()

Determines if a Cache should operate in "write-through" mode.

Method Detail

getKeyTypeback to summary
public String getKeyType()

Determines the required type of keys for this Cache, if any.

Returns:String

the fully qualified class name of the key type, or "java.lang.Object" if the type is undefined.

getValueTypeback to summary
public String getValueType()

Determines the required type of values for this Cache, if any.

Returns:String

the fully qualified class name of the value type, or "java.lang.Object" if the type is undefined.

isManagementEnabledback to summary
public boolean isManagementEnabled()

Checks whether management is enabled on this cache.

The default value is false.

Returns:boolean

true if management is enabled

isReadThroughback to summary
public boolean isReadThrough()

Determines if a Cache 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, Cache#getAll, Cache#getAndRemove and/or Cache#getAndReplace will appropriately cause the configured CacheLoader to be invoked.

The default value is false.

Returns:boolean

true when a Cache is in "read-through" mode.

See Also
CacheLoader
isStatisticsEnabledback to summary
public boolean isStatisticsEnabled()

Checks whether statistics collection is enabled in this cache.

The default value is false.

Returns:boolean

true if statistics collection is enabled

isStoreByValueback to summary
public 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.
Storage by reference only applies to the local heap. If an entry is moved off heap it will need to be transformed into a representation. Any mutations that occur after transformation may not be reflected in the cache.

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:boolean

true if the cache is store by value

isWriteThroughback to summary
public boolean isWriteThrough()

Determines if a Cache 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, Cache#getAndRemove, Cache#removeAll, Cache#getAndPut Cache#getAndRemove, Cache#getAndReplace, Cache#invoke Cache#invokeAll

will appropriately cause the configured CacheWriter to be invoked.

The default value is false.

Returns:boolean

true when a Cache is in "write-through" mode.

See Also
CacheWriter