K - the type of keys maintained the cacheV - the type of cached valuespublic abstract class Configuration<K,V> extends Object implements Serializable
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.| Constructor and Description |
|---|
Configuration() |
| Modifier and Type | Method and Description |
|---|---|
abstract List<CacheEntryListenerConfiguration<K,V>> |
getCacheEntryListenerConfigurations()
|
abstract Factory<CacheLoader<K,V>> |
getCacheLoaderFactory()
Gets the
Factory for the CacheLoader, if
any. |
abstract Factory<CacheWriter<? super K,? super V>> |
getCacheWriterFactory()
Gets the
Factory for the CacheWriter, if
any. |
abstract Factory<ExpiryPolicy<? super K>> |
getExpiryPolicyFactory()
Gets the
Factory for the ExpiryPolicy to be used
for caches. |
abstract Class<K> |
getKeyType()
Determines the required type of keys for
Caches configured
with this Configuration. |
abstract IsolationLevel |
getTransactionIsolationLevel()
Gets the transaction isolation level.
|
abstract Mode |
getTransactionMode()
Gets the transaction mode.
|
abstract Class<V> |
getValueType()
Determines the required type of values for
Caches configured
with this Configuration. |
abstract boolean |
isManagementEnabled()
Checks whether management is enabled on this cache.
|
abstract boolean |
isReadThrough()
Determines if a
Cache should operate in read-through mode. |
abstract boolean |
isStatisticsEnabled()
Checks whether statistics collection is enabled in this cache.
|
abstract boolean |
isStoreByValue()
Whether storeByValue (true) or storeByReference (false).
|
abstract boolean |
isTransactionsEnabled()
Checks whether transactions are enabled for this cache.
|
abstract boolean |
isWriteThrough()
Determines if a
Cache should operate in write-through mode. |
public abstract Class<K> getKeyType()
Caches configured
with this Configuration.Object.class if the type is undefinedpublic abstract Class<V> getValueType()
Caches configured
with this Configuration.Object.class if the type is undefinedpublic abstract boolean isReadThrough()
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" will appropriately
cause
the configured CacheLoader to be invoked.
The default value is false.true when a Cache is in "read-through"
mode.getCacheLoaderFactory()public abstract boolean isWriteThrough()
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(Object, Object),
Cache.getAndRemove(Object),
Cache.removeAll(), Cache.getAndPut(Object,
Object)
Cache.getAndRemove(Object), Cache.getAndReplace(Object,
Object),
Cache.invoke(Object, javax.cache.processor.EntryProcessor,
Object...),
Cache.invokeAll(java.util.Set, javax.cache.processor.EntryProcessor,
Object...)
will appropriately cause the configured CacheWriter
to be invoked.
The default value is false.true when a Cache is in "write-through"
mode.getCacheWriterFactory()public abstract boolean isStoreByValue()
true.public abstract boolean isStatisticsEnabled()
false.public abstract boolean isManagementEnabled()
false.public abstract boolean isTransactionsEnabled()
false.public abstract IsolationLevel getTransactionIsolationLevel()
IsolationLevel.NONE.public abstract Mode getTransactionMode()
Mode.NONE.public abstract List<CacheEntryListenerConfiguration<K,V>> getCacheEntryListenerConfigurations()
Iterable over the CacheEntryListenerConfigurationspublic abstract Factory<CacheLoader<K,V>> getCacheLoaderFactory()
Factory for the CacheLoader, if
any.
A CacheLoader should be configured for "Read Through" caches
to load values when a cache miss occurs using either the
Cache.get(Object) and/or Cache.getAll(java.util.Set)
methods.
The default value is null.Factory for the CacheLoader or
null if none has been set.public abstract Factory<CacheWriter<? super K,? super V>> getCacheWriterFactory()
Factory for the CacheWriter or
null if none has been set.public abstract Factory<ExpiryPolicy<? super K>> getExpiryPolicyFactory()
Factory for the ExpiryPolicy to be used
for caches.
The default value is a Factory that will produce a
EternalExpiryPolicy instance.Factory for ExpiryPolicy (must not be
null)Copyright © 2013. All Rights Reserved.