Package com.hazelcast.config
Interface CacheConfiguration<K,V> 
- Type Parameters:
- K- the type of key
- V- the type of value
- All Superinterfaces:
- javax.cache.configuration.CompleteConfiguration<K,,- V> - javax.cache.configuration.Configuration<K,,- V> - Serializable
- All Known Implementing Classes:
- AbstractCacheConfig,- CacheConfig
public interface CacheConfiguration<K,V> 
extends javax.cache.configuration.CompleteConfiguration<K,V> 
Mutable extension to 
CompleteConfiguration- 
Method SummaryModifier and TypeMethodDescriptionaddCacheEntryListenerConfiguration(javax.cache.configuration.CacheEntryListenerConfiguration<K, V> cacheEntryListenerConfiguration) Add a configuration for aCacheEntryListener.removeCacheEntryListenerConfiguration(javax.cache.configuration.CacheEntryListenerConfiguration<K, V> cacheEntryListenerConfiguration) Remove a configuration for aCacheEntryListener.setCacheLoaderFactory(javax.cache.configuration.Factory<? extends javax.cache.integration.CacheLoader<K, V>> factory) Set theCacheLoaderfactory.setCacheWriterFactory(javax.cache.configuration.Factory<? extends javax.cache.integration.CacheWriter<? super K, ? super V>> factory) Set theCacheWriterfactory.setExpiryPolicyFactory(javax.cache.configuration.Factory<? extends javax.cache.expiry.ExpiryPolicy> factory) Set theFactoryfor theExpiryPolicy.setManagementEnabled(boolean enabled) Sets whether management is enabled on a cache.setReadThrough(boolean isReadThrough) Set if read-through caching should be used.setStatisticsEnabled(boolean enabled) Sets whether statistics gathering is enabled on a cache.setStoreByValue(boolean isStoreByValue) Set if a configured cache should use store-by-value or store-by-reference semantics.Sets the expected type of keys and values for aCacheconfigured with thisConfiguration.setWriteThrough(boolean isWriteThrough) Set if write-through caching should be used.Methods inherited from interface javax.cache.configuration.CompleteConfigurationgetCacheEntryListenerConfigurations, getCacheLoaderFactory, getCacheWriterFactory, getExpiryPolicyFactory, isManagementEnabled, isReadThrough, isStatisticsEnabled, isWriteThroughMethods inherited from interface javax.cache.configuration.ConfigurationgetKeyType, getValueType, isStoreByValue
- 
Method Details- 
setTypesSets the expected type of keys and values for aCacheconfigured with thisConfiguration. Setting both toObject.classmeans type-safety checks are not required.This is used by CacheManagerto ensure that the key and value types are the same as those configured for theCacheprior to returning a requested cache from this method.Implementations may further perform type checking on mutative cache operations and throw a ClassCastExceptionif these checks fail.- Parameters:
- keyType- the expected key type
- valueType- the expected value type
- Returns:
- the CacheConfigurationto permit fluent-style method calls
- Throws:
- NullPointerException- should the key or value type be- null
- See Also:
- 
- CacheManager.getCache(String, Class, Class)
 
 
- 
addCacheEntryListenerConfigurationCacheConfiguration<K,V> addCacheEntryListenerConfiguration(javax.cache.configuration.CacheEntryListenerConfiguration<K, V> cacheEntryListenerConfiguration) Add a configuration for aCacheEntryListener.- Parameters:
- cacheEntryListenerConfiguration- the- CacheEntryListenerConfiguration
- Returns:
- the CacheConfigurationto permit fluent-style method calls
- Throws:
- IllegalArgumentException- if the same CacheEntryListenerConfiguration is used more than once
 
- 
removeCacheEntryListenerConfigurationCacheConfiguration<K,V> removeCacheEntryListenerConfiguration(javax.cache.configuration.CacheEntryListenerConfiguration<K, V> cacheEntryListenerConfiguration) Remove a configuration for aCacheEntryListener.- Parameters:
- cacheEntryListenerConfiguration- the- CacheEntryListenerConfigurationto remove
- Returns:
- the CacheConfigurationto permit fluent-style method calls
 
- 
setCacheLoaderFactoryCacheConfiguration<K,V> setCacheLoaderFactory(javax.cache.configuration.Factory<? extends javax.cache.integration.CacheLoader<K, V>> factory) Set theCacheLoaderfactory.- Parameters:
- factory- the- CacheLoader- Factory
- Returns:
- the CacheConfigurationto permit fluent-style method calls
 
- 
setCacheWriterFactoryCacheConfiguration<K,V> setCacheWriterFactory(javax.cache.configuration.Factory<? extends javax.cache.integration.CacheWriter<? super K, ? super V>> factory) Set theCacheWriterfactory.- Parameters:
- factory- the- CacheWriter- Factory
- Returns:
- the CacheConfigurationto permit fluent-style method calls
 
- 
setExpiryPolicyFactoryCacheConfiguration<K,V> setExpiryPolicyFactory(javax.cache.configuration.Factory<? extends javax.cache.expiry.ExpiryPolicy> factory) Set theFactoryfor theExpiryPolicy. Ifnullis specified the defaultExpiryPolicyis used.- Parameters:
- factory- the- ExpiryPolicy- Factory
- Returns:
- the CacheConfigurationto permit fluent-style method calls
 
- 
setReadThroughSet if read-through caching should be used.It is an invalid configuration to set this to truewithout specifying aCacheLoaderFactory.- Parameters:
- isReadThrough-- trueif read-through is required,- falseotherwise
- Returns:
- the CacheConfigurationto permit fluent-style method calls
 
- 
setWriteThroughSet if write-through caching should be used.It is an invalid configuration to set this to truewithout specifying aCacheWriterFactory.- Parameters:
- isWriteThrough-- trueif write-through is required,- falseotherwise
- Returns:
- the CacheConfigurationto permit fluent-style method calls
 
- 
setStoreByValueSet if a configured cache should use store-by-value or store-by-reference semantics.- Parameters:
- isStoreByValue-- trueif store-by-value is required,- falsefor store-by-reference
- Returns:
- the CacheConfigurationto permit fluent-style method calls
 
- 
setStatisticsEnabledSets whether statistics gathering is enabled on a cache.Statistics may be enabled or disabled at runtime via CacheManager.enableStatistics(String, boolean).- Parameters:
- enabled-- trueto enable statistics,- falseto disable
- Returns:
- the CacheConfigurationto permit fluent-style method calls
 
- 
setManagementEnabledSets whether management is enabled on a cache.Management may be enabled or disabled at runtime via CacheManager.enableManagement(String, boolean).- Parameters:
- enabled-- trueto enable management,- falseto disable
- Returns:
- the CacheConfigurationto permit fluent-style method calls
 
 
-