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
public interface CompleteConfiguration<K,V> extends Configuration<K,V>, Serializable
A read-only representation of the complete JCacheCache
configuration.The properties provided by instances of this interface are used by
CacheManager
s to configureCache
s.Implementations of this interface must override
Object.hashCode()
andObject.equals(Object)
asCompleteConfiguration
s are often compared at runtime.- Since:
- 1.0
- Author:
- Greg Luck, Yannis Cosmadopoulos, Brian Oliver
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Iterable<CacheEntryListenerConfiguration<K,V>>
getCacheEntryListenerConfigurations()
Factory<CacheLoader<K,V>>
getCacheLoaderFactory()
Gets theFactory
for theCacheLoader
, if any.Factory<CacheWriter<? super K,? super V>>
getCacheWriterFactory()
Gets theFactory
for theCacheWriter
, if any.Factory<ExpiryPolicy>
getExpiryPolicyFactory()
Gets theFactory
for theExpiryPolicy
to be used for caches.boolean
isManagementEnabled()
Checks whether management is enabled on this cache.boolean
isReadThrough()
Determines if aCache
should operate in read-through mode.boolean
isStatisticsEnabled()
Checks whether statistics collection is enabled in this cache.boolean
isWriteThrough()
Determines if aCache
should operate in write-through mode.-
Methods inherited from interface javax.cache.configuration.Configuration
getKeyType, getValueType, isStoreByValue
-
-
-
-
Method Detail
-
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:
getCacheLoaderFactory()
-
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:
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
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
)
-
-