Interface CompleteConfiguration<K,V>
- Type Parameters:
K- the type of keys maintained the cacheV- the type of cached values
- All Superinterfaces:
Configuration<K,V>, Serializable
- All Known Implementing Classes:
MutableConfiguration
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
CompleteConfigurations are often compared at
runtime.
- Since:
- 1.0
-
Method Summary
Modifier and TypeMethodDescriptionFactory<CacheLoader<K, V>> Gets theFactoryfor theCacheLoader, if any.Factory<CacheWriter<? super K, ? super V>> Gets theFactoryfor theCacheWriter, if any.Gets theFactoryfor theExpiryPolicyto be used for caches.booleanChecks whether management is enabled on this cache.booleanDetermines if aCacheshould operate in read-through mode.booleanChecks whether statistics collection is enabled in this cache.booleanDetermines if aCacheshould operate in write-through mode.Methods inherited from interface Configuration
getKeyType, getValueType, isStoreByValue
-
Method Details
-
isReadThrough
boolean isReadThrough()Determines if aCacheshould 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
CacheLoaderto be invoked.The default value is
false.- Returns:
truewhen aCacheis in "read-through" mode.- See Also:
-
isWriteThrough
boolean isWriteThrough()Determines if aCacheshould 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 configuredCacheWriterto be invoked.The default value is
false.- Returns:
truewhen aCacheis in "write-through" mode.- See Also:
-
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
-
getCacheEntryListenerConfigurations
Iterable<CacheEntryListenerConfiguration<K,V>> getCacheEntryListenerConfigurations()- Returns:
- an
Iterableover theCacheEntryListenerConfigurations
-
getCacheLoaderFactory
Factory<CacheLoader<K,V>> getCacheLoaderFactory()Gets theFactoryfor theCacheLoader, 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/orCache.getAll(java.util.Set)methods.The default value is
null.- Returns:
- the
Factoryfor theCacheLoaderor null if none has been set.
-
getCacheWriterFactory
Factory<CacheWriter<? super K, ? super V>> getCacheWriterFactory()- Returns:
- the
Factoryfor theCacheWriteror null if none has been set.
-
getExpiryPolicyFactory
Factory<ExpiryPolicy> getExpiryPolicyFactory()Gets theFactoryfor theExpiryPolicyto be used for caches.The default value is a
Factorythat will produce aEternalExpiryPolicyinstance.- Returns:
- the
FactoryforExpiryPolicy(must not benull)
-