Interface CompleteConfiguration<K,V>
-
- Type Parameters:
K- the type of keys maintained the cacheV- the type of cached values
- All Superinterfaces:
Configuration<K,V>,java.io.Serializable
- All Known Implementing Classes:
MutableConfiguration
public interface CompleteConfiguration<K,V> extends Configuration<K,V>, java.io.Serializable
A read-only representation of the complete JCacheCacheconfiguration.The properties provided by instances of this interface are used by
CacheManagers to configureCaches.Implementations of this interface must override
Object.hashCode()andObject.equals(Object)asCompleteConfigurations are often compared at runtime.- Since:
- 1.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Iterable<CacheEntryListenerConfiguration<K,V>>getCacheEntryListenerConfigurations()Factory<CacheLoader<K,V>>getCacheLoaderFactory()Gets theFactoryfor theCacheLoader, if any.Factory<CacheWriter<? super K,? super V>>getCacheWriterFactory()Gets theFactoryfor theCacheWriter, if any.Factory<ExpiryPolicy>getExpiryPolicyFactory()Gets theFactoryfor theExpiryPolicyto be used for caches.booleanisManagementEnabled()Checks whether management is enabled on this cache.booleanisReadThrough()Determines if aCacheshould operate in read-through mode.booleanisStatisticsEnabled()Checks whether statistics collection is enabled in this cache.booleanisWriteThrough()Determines if aCacheshould operate in write-through mode.-
Methods inherited from interface javax.cache.configuration.Configuration
getKeyType, getValueType, isStoreByValue
-
-
-
-
Method Detail
-
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:
getCacheLoaderFactory()
-
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:
getCacheWriterFactory()
-
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
java.lang.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)
-
-