Package one.microstream.cache.types
Class CacheConfiguration.Builder.Default<K,V>
java.lang.Object
one.microstream.cache.types.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>
serializerFoundation(SerializerFoundation<?> serializerFoundation)
Set the serializer foundation.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
- Returns:
- this
-
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
- Returns:
- this
-
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
- Returns:
- this
-
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
- Returns:
- this
- 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
- Returns:
- this
- 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- Returns:
- this
-
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- Returns:
- this
-
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- Returns:
- this
-
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.- Returns:
- this
-
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.- Returns:
- this
-
serializerFoundation
public CacheConfiguration.Builder<K,V> serializerFoundation(SerializerFoundation<?> serializerFoundation)Description copied from interface:CacheConfiguration.Builder
Set the serializer foundation.- Specified by:
serializerFoundation
in interfaceCacheConfiguration.Builder<K,V>
- Parameters:
serializerFoundation
- the foundation which the serializer will be based on- Returns:
- this
-
build
Description copied from interface:CacheConfiguration.Builder
Builds aCacheConfiguration
based on the values of thisCacheConfiguration.Builder
.- Specified by:
build
in interfaceCacheConfiguration.Builder<K,V>
- Returns:
- the created configuration
-