Top Description Methods
javax.cache.configuration

public Interface Configuration<K, V>

extends Serializable
Known Direct Subinterfaces
javax.cache.configuration.CompleteConfiguration
Type Parameters
<K>
the type of keys maintained the cache
<V>
the type of cached values
Imports
javax.cache.Cache, .CacheManager, java.io.Serializable

A basic read-only representation of a Cache configuration.

The properties provided by instances of this interface are used by CacheManagers to configure Caches.

Implementations of this interface must override Object#hashCode() and Object#equals(Object) as Configurations are often compared at runtime.

Authors
Greg Luck, Brian Oliver
Since
1.0

Method Summary

Modifier and TypeMethod and Description
public Class<K>

Returns:

the key type or Object.class if the type is undefined
getKeyType
()

Determines the required type of keys for Caches configured with this Configuration.

public Class<V>

Returns:

the value type or Object.class if the type is undefined
getValueType
()

Determines the required type of values for Caches configured with this Configuration.

public boolean

Returns:

true if the cache is store by value
isStoreByValue
()

Whether storeByValue (true) or storeByReference (false).

Method Detail

getKeyTypeback to summary
public Class<K> getKeyType()

Determines the required type of keys for Caches configured with this Configuration.

Returns:Class<K>

the key type or Object.class if the type is undefined

getValueTypeback to summary
public Class<V> getValueType()

Determines the required type of values for Caches configured with this Configuration.

Returns:Class<V>

the value type or Object.class if the type is undefined

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