Class CacheConfiguration.Builder.Default<K,V>
- All Implemented Interfaces:
CacheConfiguration.Builder<K,V>
- Enclosing interface:
- CacheConfiguration.Builder<K,V>
public static class CacheConfiguration.Builder.Default<K,V> extends Object implements CacheConfiguration.Builder<K,V>
-
Nested Class Summary
Nested classes/interfaces inherited from interface one.microstream.cache.types.CacheConfiguration.Builder
CacheConfiguration.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 aCacheConfiguration
based on the values of thisCacheConfiguration.Builder
.CacheConfiguration.Builder<K,V>
cacheLoaderFactory(javax.cache.configuration.Factory<javax.cache.integration.CacheLoader<K,V>> cacheLoaderFactory)
Set theCacheLoader
Factory
.CacheConfiguration.Builder<K,V>
cacheWriterFactory(javax.cache.configuration.Factory<javax.cache.integration.CacheWriter<? super K,? super V>> cacheWriterFactory)
Set theCacheWriter
Factory
.CacheConfiguration.Builder<K,V>
enableManagement(boolean managementEnabled)
Sets whether the management bean is enabled.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 theEvictionManager
Factory
.CacheConfiguration.Builder<K,V>
expiryPolicyFactory(javax.cache.configuration.Factory<javax.cache.expiry.ExpiryPolicy> expiryPolicyFactory)
Set theFactory
for theExpiryPolicy
.CacheConfiguration.Builder<K,V>
readThrough(boolean readThrough)
Set if read-through caching should be used.CacheConfiguration.Builder<K,V>
serializerFieldPredicate(Predicate<? super Field> serializerFieldPredicate)
CacheConfiguration.Builder<K,V>
storeByValue(boolean storeByValue)
Set if a configured cache should use store-by-value or store-by-reference semantics.CacheConfiguration.Builder<K,V>
writeThrough(boolean writeThrough)
Set if write-through caching should be used.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface one.microstream.cache.types.CacheConfiguration.Builder
disableManagement, disableStatistics, enableManagement, enableStatistics, readThrough, storeByReference, storeByValue, writeThrough
-
Method Details
-
addListenerConfiguration
public CacheConfiguration.Builder<K,V> addListenerConfiguration(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> listenerConfiguration)Description copied from interface:CacheConfiguration.Builder
Add a configuration for aCacheEntryListener
.- Specified by:
addListenerConfiguration
in interfaceCacheConfiguration.Builder<K,V>
- Parameters:
listenerConfiguration
- theCacheEntryListenerConfiguration
-
cacheLoaderFactory
public CacheConfiguration.Builder<K,V> cacheLoaderFactory(javax.cache.configuration.Factory<javax.cache.integration.CacheLoader<K,V>> cacheLoaderFactory)Description copied from interface:CacheConfiguration.Builder
Set theCacheLoader
Factory
.- Specified by:
cacheLoaderFactory
in interfaceCacheConfiguration.Builder<K,V>
- Parameters:
cacheLoaderFactory
- theCacheLoader
Factory
-
cacheWriterFactory
public CacheConfiguration.Builder<K,V> cacheWriterFactory(javax.cache.configuration.Factory<javax.cache.integration.CacheWriter<? super K,? super V>> cacheWriterFactory)Description copied from interface:CacheConfiguration.Builder
Set theCacheWriter
Factory
.- Specified by:
cacheWriterFactory
in interfaceCacheConfiguration.Builder<K,V>
- Parameters:
cacheWriterFactory
- theCacheWriter
Factory
-
expiryPolicyFactory
public CacheConfiguration.Builder<K,V> expiryPolicyFactory(javax.cache.configuration.Factory<javax.cache.expiry.ExpiryPolicy> expiryPolicyFactory)Description copied from interface:CacheConfiguration.Builder
Set theFactory
for theExpiryPolicy
. Ifnull
is specified the defaultExpiryPolicy
is used.Only one expiry policy can be set for a cache. The last policy applied before cache construction will be the one used.
- Specified by:
expiryPolicyFactory
in interfaceCacheConfiguration.Builder<K,V>
- Parameters:
expiryPolicyFactory
- theExpiryPolicy
Factory
- See Also:
CacheConfiguration.DefaultExpiryPolicyFactory()
-
evictionManagerFactory
public CacheConfiguration.Builder<K,V> evictionManagerFactory(javax.cache.configuration.Factory<EvictionManager<K,V>> evictionManagerFactory)Description copied from interface:CacheConfiguration.Builder
Set theEvictionManager
Factory
. Ifnull
is specified the defaultEvictionManager
is used.Only one eviction manager can be set for a cache. The last manager applied before cache construction will be the one used.
- Specified by:
evictionManagerFactory
in interfaceCacheConfiguration.Builder<K,V>
- Parameters:
evictionManagerFactory
- theEvictionManager
Factory
- See Also:
CacheConfiguration.DefaultEvictionManagerFactory()
-
readThrough
Description copied from interface:CacheConfiguration.Builder
Set if read-through caching should be used.It is an invalid configuration to set this to true without specifying a
CacheLoader
Factory
.- Specified by:
readThrough
in interfaceCacheConfiguration.Builder<K,V>
- Parameters:
readThrough
-true
if read-through is required
-
writeThrough
Description copied from interface:CacheConfiguration.Builder
Set if write-through caching should be used.It is an invalid configuration to set this to true without specifying a
CacheWriter
Factory
.- Specified by:
writeThrough
in interfaceCacheConfiguration.Builder<K,V>
- Parameters:
writeThrough
-true
if write-through is required
-
storeByValue
Description copied from interface:CacheConfiguration.Builder
Set if a configured cache should use store-by-value or store-by-reference semantics.- Specified by:
storeByValue
in interfaceCacheConfiguration.Builder<K,V>
- Parameters:
storeByValue
-true
if store-by-value is required,false
for store-by-reference
-
enableStatistics
Description copied from interface:CacheConfiguration.Builder
Sets whether statistics gathering is enabled.Statistics may be enabled or disabled at runtime via
CacheManager.enableStatistics(String, boolean)
orCache.setStatisticsEnabled(boolean)
.- Specified by:
enableStatistics
in interfaceCacheConfiguration.Builder<K,V>
- Parameters:
statisticsEnabled
- true to enable statistics, false to disable.
-
enableManagement
Description copied from interface:CacheConfiguration.Builder
Sets whether the management bean is enabled.Management may be enabled or disabled at runtime via
CacheManager.enableManagement(String, boolean)
orCache.setManagementEnabled(boolean)
.- Specified by:
enableManagement
in interfaceCacheConfiguration.Builder<K,V>
- Parameters:
managementEnabled
- true to enable statistics, false to disable.
-
serializerFieldPredicate
public CacheConfiguration.Builder<K,V> serializerFieldPredicate(Predicate<? super Field> serializerFieldPredicate)Description copied from interface:CacheConfiguration.Builder
Set the SerializerField
Predicate
. Ifnull
is specified the defaultPredicate
is used.Only one predicate can be set for a cache. The last one applied before cache construction will be the one used.
- Specified by:
serializerFieldPredicate
in interfaceCacheConfiguration.Builder<K,V>
- Parameters:
serializerFieldPredicate
- the SerializerField
Predicate
- See Also:
CacheConfiguration.DefaultSerializerFieldPredicate()
-
build
Description copied from interface:CacheConfiguration.Builder
Builds aCacheConfiguration
based on the values of thisCacheConfiguration.Builder
.- Specified by:
build
in interfaceCacheConfiguration.Builder<K,V>
-