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
CacheManager
s to configure Cache
s.
Implementations of this interface must override Object.hashCode()
and
Object.equals(Object)
as
CompleteConfiguration
s are often compared at
runtime.
- Since:
- 1.0
-
Method Summary
Modifier and TypeMethodDescriptionFactory
<CacheLoader<K, V>> Gets theFactory
for theCacheLoader
, if any.Factory
<CacheWriter<? super K, ? super V>> Gets theFactory
for theCacheWriter
, if any.Gets theFactory
for theExpiryPolicy
to be used for caches.boolean
Checks whether management is enabled on this cache.boolean
Determines if aCache
should operate in read-through mode.boolean
Checks whether statistics collection is enabled in this cache.boolean
Determines if aCache
should operate in write-through mode.Methods inherited from interface javax.cache.configuration.Configuration
getKeyType, getValueType, isStoreByValue
-
Method Details
-
isReadThrough
boolean isReadThrough()Determines if aCache
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
.- Returns:
true
when aCache
is in "read-through" mode.- See Also:
-
isWriteThrough
boolean isWriteThrough()Determines if aCache
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 configuredCacheWriter
to be invoked.The default value is
false
.- Returns:
true
when aCache
is 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
Iterable
over theCacheEntryListenerConfiguration
s
-
getCacheLoaderFactory
Factory<CacheLoader<K,V>> getCacheLoaderFactory()Gets theFactory
for 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
Factory
for theCacheLoader
or null if none has been set.
-
getCacheWriterFactory
Factory<CacheWriter<? super K,? super V>> getCacheWriterFactory()- Returns:
- the
Factory
for theCacheWriter
or null if none has been set.
-
getExpiryPolicyFactory
Factory<ExpiryPolicy> getExpiryPolicyFactory()Gets theFactory
for theExpiryPolicy
to be used for caches.The default value is a
Factory
that will produce aEternalExpiryPolicy
instance.- Returns:
- the
Factory
forExpiryPolicy
(must not benull
)
-