K
- the type of keyV
- the type of valuepublic interface CacheConfiguration<K,V>
extends javax.cache.configuration.CompleteConfiguration<K,V>
CompleteConfiguration
Modifier and Type | Method and Description |
---|---|
CacheConfiguration<K,V> |
addCacheEntryListenerConfiguration(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> cacheEntryListenerConfiguration)
Add a configuration for a
CacheEntryListener . |
CacheConfiguration<K,V> |
removeCacheEntryListenerConfiguration(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> cacheEntryListenerConfiguration)
Remove a configuration for a
CacheEntryListener . |
CacheConfiguration<K,V> |
setCacheLoaderFactory(javax.cache.configuration.Factory<? extends javax.cache.integration.CacheLoader<K,V>> factory)
Set the
CacheLoader factory. |
CacheConfiguration<K,V> |
setCacheWriterFactory(javax.cache.configuration.Factory<? extends javax.cache.integration.CacheWriter<? super K,? super V>> factory)
Set the
CacheWriter factory. |
CacheConfiguration<K,V> |
setExpiryPolicyFactory(javax.cache.configuration.Factory<? extends javax.cache.expiry.ExpiryPolicy> factory)
Set the
Factory for the ExpiryPolicy . |
CacheConfiguration<K,V> |
setManagementEnabled(boolean enabled)
Sets whether management is enabled on a cache.
|
CacheConfiguration<K,V> |
setReadThrough(boolean isReadThrough)
Set if read-through caching should be used.
|
CacheConfiguration<K,V> |
setStatisticsEnabled(boolean enabled)
Sets whether statistics gathering is enabled on a cache.
|
CacheConfiguration<K,V> |
setStoreByValue(boolean isStoreByValue)
Set if a configured cache should use store-by-value or store-by-reference semantics.
|
CacheConfiguration<K,V> |
setTypes(Class<K> keyType,
Class<V> valueType)
Sets the expected type of keys and values for a
Cache
configured with this Configuration . |
CacheConfiguration<K,V> |
setWriteThrough(boolean isWriteThrough)
Set if write-through caching should be used.
|
CacheConfiguration<K,V> setTypes(Class<K> keyType, Class<V> valueType)
Cache
configured with this Configuration
. Setting both to
Object.class
means type-safety checks are not required.
This is used by CacheManager
to ensure that the key and value
types are the same as those configured for the Cache
prior to
returning a requested cache from this method.
Implementations may further perform type checking on mutative cache operations
and throw a ClassCastException
if these checks fail.
keyType
- the expected key typevalueType
- the expected value typeCacheConfiguration
to permit fluent-style method callsNullPointerException
- should the key or value type be null
CacheManager.getCache(String, Class, Class)
CacheConfiguration<K,V> addCacheEntryListenerConfiguration(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> cacheEntryListenerConfiguration)
CacheEntryListener
.cacheEntryListenerConfiguration
- the CacheEntryListenerConfiguration
CacheConfiguration
to permit fluent-style method callsIllegalArgumentException
- if the same CacheEntryListenerConfiguration
is used more than onceCacheConfiguration<K,V> removeCacheEntryListenerConfiguration(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> cacheEntryListenerConfiguration)
CacheEntryListener
.cacheEntryListenerConfiguration
- the CacheEntryListenerConfiguration
to removeCacheConfiguration
to permit fluent-style method callsCacheConfiguration<K,V> setCacheLoaderFactory(javax.cache.configuration.Factory<? extends javax.cache.integration.CacheLoader<K,V>> factory)
CacheLoader
factory.factory
- the CacheLoader
Factory
CacheConfiguration
to permit fluent-style method callsCacheConfiguration<K,V> setCacheWriterFactory(javax.cache.configuration.Factory<? extends javax.cache.integration.CacheWriter<? super K,? super V>> factory)
CacheWriter
factory.factory
- the CacheWriter
Factory
CacheConfiguration
to permit fluent-style method callsCacheConfiguration<K,V> setExpiryPolicyFactory(javax.cache.configuration.Factory<? extends javax.cache.expiry.ExpiryPolicy> factory)
Factory
for the ExpiryPolicy
.
If null
is specified the default ExpiryPolicy
is used.factory
- the ExpiryPolicy
Factory
CacheConfiguration
to permit fluent-style method callsCacheConfiguration<K,V> setReadThrough(boolean isReadThrough)
It is an invalid configuration to set this to true
without specifying a
CacheLoader
Factory
.
isReadThrough
- true
if read-through is required, false
otherwiseCacheConfiguration
to permit fluent-style method callsCacheConfiguration<K,V> setWriteThrough(boolean isWriteThrough)
It is an invalid configuration to set this to true
without specifying a
CacheWriter
Factory
.
isWriteThrough
- true
if write-through is required, false
otherwiseCacheConfiguration
to permit fluent-style method callsCacheConfiguration<K,V> setStoreByValue(boolean isStoreByValue)
isStoreByValue
- true
if store-by-value is required,
false
for store-by-referenceCacheConfiguration
to permit fluent-style method callsCacheConfiguration<K,V> setStatisticsEnabled(boolean enabled)
Statistics may be enabled or disabled at runtime via
CacheManager.enableStatistics(String, boolean)
.
enabled
- true
to enable statistics, false
to disableCacheConfiguration
to permit fluent-style method callsCacheConfiguration<K,V> setManagementEnabled(boolean enabled)
Management may be enabled or disabled at runtime via
CacheManager.enableManagement(String, boolean)
.
enabled
- true
to enable statistics, false
to disableCacheConfiguration
to permit fluent-style method callsCopyright © 2018 Hazelcast, Inc.. All Rights Reserved.