|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
K
- the type of key.V
- the type of value.public interface CacheConfiguration<K,V>
Mutable extension to CompleteConfiguration
Method Summary | |
---|---|
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. |
Methods inherited from interface javax.cache.configuration.CompleteConfiguration |
---|
getCacheEntryListenerConfigurations, getCacheLoaderFactory, getCacheWriterFactory, getExpiryPolicyFactory, isManagementEnabled, isReadThrough, isStatisticsEnabled, isWriteThrough |
Methods inherited from interface javax.cache.configuration.Configuration |
---|
getKeyType, getValueType, isStoreByValue |
Method Detail |
---|
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 type
CacheConfiguration
to permit fluent-style method calls
NullPointerException
- should the key or value type be nullCacheManager.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 calls
IllegalArgumentException
- is the same CacheEntryListenerConfiguration
is used more than onceCacheConfiguration<K,V> removeCacheEntryListenerConfiguration(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> cacheEntryListenerConfiguration)
CacheEntryListener
.
cacheEntryListenerConfiguration
- the
CacheEntryListenerConfiguration
to remove
CacheConfiguration
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
CacheConfiguration
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
CacheConfiguration
to permit fluent-style method callsCacheConfiguration<K,V> setStoreByValue(boolean isStoreByValue)
isStoreByValue
- true
if store-by-value is required,
false
for store-by-reference
CacheConfiguration
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 disable.
CacheConfiguration
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 disable.
CacheConfiguration
to permit fluent-style method calls
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |