Interface CacheConfiguration.Builder<K,V>
- All Known Implementing Classes:
CacheConfiguration.Builder.Default
- Enclosing interface:
- CacheConfiguration<K,V>
public static interface CacheConfiguration.Builder<K,V>
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classCacheConfiguration.Builder.Default<K,V> -
Method Summary
Modifier and Type Method Description CacheConfiguration.Builder<K,V>addListenerConfiguration(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> listenerConfiguration)Add a configuration for aCacheEntryListener.CacheConfiguration<K,V>build()Builds aCacheConfigurationbased on the values of thisCacheConfiguration.Builder.CacheConfiguration.Builder<K,V>cacheLoaderFactory(javax.cache.configuration.Factory<javax.cache.integration.CacheLoader<K,V>> cacheLoaderFactory)Set theCacheLoaderFactory.CacheConfiguration.Builder<K,V>cacheWriterFactory(javax.cache.configuration.Factory<javax.cache.integration.CacheWriter<? super K,? super V>> cacheWriterFactory)Set theCacheWriterFactory.default CacheConfiguration.Builder<K,V>disableManagement()Disables the management bean.default CacheConfiguration.Builder<K,V>disableStatistics()Disables statistics gathering.default CacheConfiguration.Builder<K,V>enableManagement()Enables the management bean.CacheConfiguration.Builder<K,V>enableManagement(boolean managementEnabled)Sets whether the management bean is enabled.default CacheConfiguration.Builder<K,V>enableStatistics()Enables statistics gathering.CacheConfiguration.Builder<K,V>enableStatistics(boolean statisticsEnabled)Sets whether statistics gathering is enabled.CacheConfiguration.Builder<K,V>evictionManagerFactory(javax.cache.configuration.Factory<EvictionManager<K,V>> evictionManagerFactory)Set theEvictionManagerFactory.CacheConfiguration.Builder<K,V>expiryPolicyFactory(javax.cache.configuration.Factory<javax.cache.expiry.ExpiryPolicy> expiryPolicyFactory)Set theFactoryfor theExpiryPolicy.default CacheConfiguration.Builder<K,V>readThrough()Set that read-through caching should be used.CacheConfiguration.Builder<K,V>readThrough(boolean readThrough)Set if read-through caching should be used.CacheConfiguration.Builder<K,V>serializerFieldPredicate(Predicate<? super Field> serializerFieldPredicate)default CacheConfiguration.Builder<K,V>storeByReference()Set that store-by-reference semantics should be used.default CacheConfiguration.Builder<K,V>storeByValue()Set that store-by-value semantics should be used.CacheConfiguration.Builder<K,V>storeByValue(boolean storeByValue)Set if a configured cache should use store-by-value or store-by-reference semantics.default CacheConfiguration.Builder<K,V>writeThrough()Set that write-through caching should be used.CacheConfiguration.Builder<K,V>writeThrough(boolean writeThrough)Set if write-through caching should be used.
-
Method Details
-
addListenerConfiguration
CacheConfiguration.Builder<K,V> addListenerConfiguration(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> listenerConfiguration)Add a configuration for aCacheEntryListener.- Parameters:
listenerConfiguration- theCacheEntryListenerConfiguration
-
cacheLoaderFactory
CacheConfiguration.Builder<K,V> cacheLoaderFactory(javax.cache.configuration.Factory<javax.cache.integration.CacheLoader<K,V>> cacheLoaderFactory)Set theCacheLoaderFactory.- Parameters:
cacheLoaderFactory- theCacheLoaderFactory
-
cacheWriterFactory
CacheConfiguration.Builder<K,V> cacheWriterFactory(javax.cache.configuration.Factory<javax.cache.integration.CacheWriter<? super K,? super V>> cacheWriterFactory)Set theCacheWriterFactory.- Parameters:
cacheWriterFactory- theCacheWriterFactory
-
expiryPolicyFactory
CacheConfiguration.Builder<K,V> expiryPolicyFactory(javax.cache.configuration.Factory<javax.cache.expiry.ExpiryPolicy> expiryPolicyFactory)Set theFactoryfor theExpiryPolicy. Ifnullis specified the defaultExpiryPolicyis used.Only one expiry policy can be set for a cache. The last policy applied before cache construction will be the one used.
- Parameters:
expiryPolicyFactory- theExpiryPolicyFactory- See Also:
CacheConfiguration.DefaultExpiryPolicyFactory()
-
evictionManagerFactory
CacheConfiguration.Builder<K,V> evictionManagerFactory(javax.cache.configuration.Factory<EvictionManager<K,V>> evictionManagerFactory)Set theEvictionManagerFactory. Ifnullis specified the defaultEvictionManageris used.Only one eviction manager can be set for a cache. The last manager applied before cache construction will be the one used.
- Parameters:
evictionManagerFactory- theEvictionManagerFactory- See Also:
CacheConfiguration.DefaultEvictionManagerFactory()
-
readThrough
Set that read-through caching should be used.It is an invalid configuration to use this without specifying a
CacheLoaderFactory. -
readThrough
Set if read-through caching should be used.It is an invalid configuration to set this to true without specifying a
CacheLoaderFactory.- Parameters:
readThrough-trueif read-through is required
-
writeThrough
Set that write-through caching should be used.It is an invalid configuration to use this without specifying a
CacheWriterFactory. -
writeThrough
Set if write-through caching should be used.It is an invalid configuration to set this to true without specifying a
CacheWriterFactory.- Parameters:
writeThrough-trueif write-through is required
-
storeByValue
Set that store-by-value semantics should be used. -
storeByReference
Set that store-by-reference semantics should be used. -
storeByValue
Set if a configured cache should use store-by-value or store-by-reference semantics.- Parameters:
storeByValue-trueif store-by-value is required,falsefor store-by-reference
-
enableStatistics
Enables statistics gathering.Statistics may be enabled or disabled at runtime via
CacheManager.enableStatistics(String, boolean)orCache.setStatisticsEnabled(boolean). -
disableStatistics
Disables statistics gathering.Statistics may be enabled or disabled at runtime via
CacheManager.enableStatistics(String, boolean)orCache.setStatisticsEnabled(boolean). -
enableStatistics
Sets whether statistics gathering is enabled.Statistics may be enabled or disabled at runtime via
CacheManager.enableStatistics(String, boolean)orCache.setStatisticsEnabled(boolean).- Parameters:
statisticsEnabled- true to enable statistics, false to disable.
-
enableManagement
Enables the management bean.Management may be enabled or disabled at runtime via
CacheManager.enableManagement(String, boolean)orCache.setManagementEnabled(boolean). -
disableManagement
Disables the management bean.Management may be enabled or disabled at runtime via
CacheManager.enableManagement(String, boolean)orCache.setManagementEnabled(boolean). -
enableManagement
Sets whether the management bean is enabled.Management may be enabled or disabled at runtime via
CacheManager.enableManagement(String, boolean)orCache.setManagementEnabled(boolean).- Parameters:
managementEnabled- true to enable statistics, false to disable.
-
serializerFieldPredicate
CacheConfiguration.Builder<K,V> serializerFieldPredicate(Predicate<? super Field> serializerFieldPredicate)Set the SerializerFieldPredicate. Ifnullis specified the defaultPredicateis used.Only one predicate can be set for a cache. The last one applied before cache construction will be the one used.
- Parameters:
serializerFieldPredicate- the SerializerFieldPredicate- See Also:
CacheConfiguration.DefaultSerializerFieldPredicate()
-
build
CacheConfiguration<K,V> build()Builds aCacheConfigurationbased on the values of thisCacheConfiguration.Builder.
-