K - V - public class CacheConfig<K,V> extends Object
ICache| Modifier and Type | Field and Description |
|---|---|
protected javax.cache.configuration.Factory<javax.cache.integration.CacheLoader<K,V>> |
cacheLoaderFactory
The
Factory for the CacheLoader. |
protected javax.cache.configuration.Factory<javax.cache.integration.CacheWriter<? super K,? super V>> |
cacheWriterFactory
The
Factory for the CacheWriter. |
static int |
DEFAULT_BACKUP_COUNT
The number of default backup counter
|
static EvictionPolicy |
DEFAULT_EVICTION_POLICY
Default Eviction Policy.
|
static InMemoryFormat |
DEFAULT_IN_MEMORY_FORMAT
Default InMemory Format.
|
protected javax.cache.configuration.Factory<javax.cache.expiry.ExpiryPolicy> |
expiryPolicyFactory
The
Factory for the ExpiryPolicy. |
protected boolean |
isManagementEnabled
Whether management is enabled
|
protected boolean |
isReadThrough
A flag indicating if "read-through" mode is required.
|
protected boolean |
isStatisticsEnabled
A flag indicating if statistics gathering is enabled.
|
protected boolean |
isStoreByValue
A flag indicating if the cache will be store-by-value or store-by-reference.
|
protected boolean |
isWriteThrough
A flag indicating if "write-through" mode is required.
|
protected Class<K> |
keyType
The type of keys for
Caches configured with this
Configuration. |
protected Set<javax.cache.configuration.CacheEntryListenerConfiguration<K,V>> |
listenerConfigurations
The
CacheEntryListenerConfigurations for the Configuration. |
static int |
MAX_BACKUP_COUNT
The number of maximum backup counter
|
static int |
MIN_BACKUP_COUNT
The number of minimum backup counter
|
protected Class<V> |
valueType
The type of values for
Caches configured with this
Configuration. |
| Constructor and Description |
|---|
CacheConfig() |
CacheConfig(javax.cache.configuration.CompleteConfiguration<K,V> configuration) |
| Modifier and Type | Method and Description |
|---|---|
javax.cache.configuration.CompleteConfiguration<K,V> |
addCacheEntryListenerConfiguration(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> cacheEntryListenerConfiguration)
Add a configuration for a
CacheEntryListener. |
protected Set<javax.cache.configuration.CacheEntryListenerConfiguration<K,V>> |
createConcurrentSet() |
boolean |
equals(Object o) |
CacheConfigReadOnly<K,V> |
getAsReadOnly()
Immutable CacheConfig instance
|
int |
getAsyncBackupCount() |
int |
getBackupCount() |
Iterable<javax.cache.configuration.CacheEntryListenerConfiguration<K,V>> |
getCacheEntryListenerConfigurations() |
javax.cache.configuration.Factory<javax.cache.integration.CacheLoader<K,V>> |
getCacheLoaderFactory() |
javax.cache.configuration.Factory<javax.cache.integration.CacheWriter<? super K,? super V>> |
getCacheWriterFactory() |
EvictionPolicy |
getEvictionPolicy() |
javax.cache.configuration.Factory<javax.cache.expiry.ExpiryPolicy> |
getExpiryPolicyFactory() |
InMemoryFormat |
getInMemoryFormat() |
Class<K> |
getKeyType() |
String |
getManagerPrefix() |
String |
getName() |
String |
getNameWithPrefix() |
NearCacheConfig |
getNearCacheConfig() |
int |
getTotalBackupCount() |
String |
getUriString() |
Class<V> |
getValueType() |
int |
hashCode() |
boolean |
isManagementEnabled() |
boolean |
isReadThrough() |
boolean |
isStatisticsEnabled() |
boolean |
isStoreByValue() |
boolean |
isWriteThrough() |
void |
readData(ObjectDataInput in)
Reads fields from the input stream
|
javax.cache.configuration.CompleteConfiguration<K,V> |
removeCacheEntryListenerConfiguration(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> cacheEntryListenerConfiguration)
Remove a configuration for a
CacheEntryListener. |
CacheConfig<K,V> |
setAsyncBackupCount(int asyncBackupCount)
Number of asynchronous backups.
|
CacheConfig<K,V> |
setBackupCount(int backupCount)
Number of synchronous backups.
|
CacheConfig<K,V> |
setEvictionPolicy(EvictionPolicy evictionPolicy) |
CacheConfig<K,V> |
setInMemoryFormat(InMemoryFormat inMemoryFormat)
Data type that will be used for storing records.
|
javax.cache.configuration.CompleteConfiguration<K,V> |
setManagementEnabled(boolean enabled)
Sets whether management is enabled on a cache.
|
CacheConfig<K,V> |
setManagerPrefix(String managerPrefix) |
CacheConfig<K,V> |
setName(String name) |
CacheConfig |
setNearCacheConfig(NearCacheConfig nearCacheConfig) |
javax.cache.configuration.CompleteConfiguration<K,V> |
setStatisticsEnabled(boolean enabled)
Sets whether statistics gathering is enabled on a cache.
|
javax.cache.configuration.CompleteConfiguration<K,V> |
setStoreByValue(boolean storeByValue)
Set if a configured cache should use store-by-value or store-by-reference
semantics.
|
javax.cache.configuration.CompleteConfiguration<K,V> |
setTypes(Class<K> keyType,
Class<V> valueType)
Sets the expected type of keys and values for a
Cache
configured with this Configuration. |
CacheConfig<K,V> |
setUriString(String uriString) |
void |
writeData(ObjectDataOutput out)
Writes object fields to output stream
|
public static final int MIN_BACKUP_COUNT
public static final int MAX_BACKUP_COUNT
public static final int DEFAULT_BACKUP_COUNT
public static final InMemoryFormat DEFAULT_IN_MEMORY_FORMAT
public static final EvictionPolicy DEFAULT_EVICTION_POLICY
protected Set<javax.cache.configuration.CacheEntryListenerConfiguration<K,V>> listenerConfigurations
CacheEntryListenerConfigurations for the Configuration.protected Class<K> keyType
Caches configured with this
Configuration.protected Class<V> valueType
Caches configured with this
Configuration.protected javax.cache.configuration.Factory<javax.cache.integration.CacheLoader<K,V>> cacheLoaderFactory
Factory for the CacheLoader.protected javax.cache.configuration.Factory<javax.cache.integration.CacheWriter<? super K,? super V>> cacheWriterFactory
Factory for the CacheWriter.protected javax.cache.configuration.Factory<javax.cache.expiry.ExpiryPolicy> expiryPolicyFactory
Factory for the ExpiryPolicy.protected boolean isReadThrough
protected boolean isWriteThrough
protected boolean isStatisticsEnabled
protected boolean isStoreByValue
protected boolean isManagementEnabled
public CacheConfigReadOnly<K,V> getAsReadOnly()
public String getName()
public CacheConfig<K,V> setName(String name)
name - the name to setpublic String getManagerPrefix()
public CacheConfig<K,V> setManagerPrefix(String managerPrefix)
public String getUriString()
public CacheConfig<K,V> setUriString(String uriString)
public String getNameWithPrefix()
public int getBackupCount()
getAsyncBackupCount()public CacheConfig<K,V> setBackupCount(int backupCount)
backupCount - the backupCount to setsetAsyncBackupCount(int)public int getAsyncBackupCount()
setBackupCount(int)public CacheConfig<K,V> setAsyncBackupCount(int asyncBackupCount)
asyncBackupCount - the asyncBackupCount to setsetBackupCount(int)public int getTotalBackupCount()
public EvictionPolicy getEvictionPolicy()
public CacheConfig<K,V> setEvictionPolicy(EvictionPolicy evictionPolicy)
evictionPolicy - the evictionPolicy to setpublic NearCacheConfig getNearCacheConfig()
public CacheConfig setNearCacheConfig(NearCacheConfig nearCacheConfig)
public InMemoryFormat getInMemoryFormat()
public CacheConfig<K,V> setInMemoryFormat(InMemoryFormat inMemoryFormat)
inMemoryFormat - the record type to setIllegalArgumentException - if inMemoryFormat is null.public void writeData(ObjectDataOutput out) throws IOException
DataSerializableout - outputIOExceptionpublic void readData(ObjectDataInput in) throws IOException
DataSerializablein - inputIOExceptionpublic int hashCode()
public boolean equals(Object o)
public javax.cache.configuration.CompleteConfiguration<K,V> addCacheEntryListenerConfiguration(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> cacheEntryListenerConfiguration)
CacheEntryListener.cacheEntryListenerConfiguration - the CacheEntryListenerConfigurationCacheConfigIllegalArgumentException - is the same CacheEntryListenerConfiguration
is used more than oncepublic javax.cache.configuration.CompleteConfiguration<K,V> removeCacheEntryListenerConfiguration(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> cacheEntryListenerConfiguration)
CacheEntryListener.cacheEntryListenerConfiguration - the CacheEntryListenerConfiguration to removeCacheConfigpublic Iterable<javax.cache.configuration.CacheEntryListenerConfiguration<K,V>> getCacheEntryListenerConfigurations()
getCacheEntryListenerConfigurations in interface javax.cache.configuration.CompleteConfiguration<K,V>public boolean isReadThrough()
isReadThrough in interface javax.cache.configuration.CompleteConfiguration<K,V>public boolean isWriteThrough()
isWriteThrough in interface javax.cache.configuration.CompleteConfiguration<K,V>public boolean isStatisticsEnabled()
isStatisticsEnabled in interface javax.cache.configuration.CompleteConfiguration<K,V>public javax.cache.configuration.CompleteConfiguration<K,V> setStatisticsEnabled(boolean enabled)
CacheManager.enableStatistics(String, boolean).enabled - true to enable statistics, false to disable.CacheConfigpublic boolean isManagementEnabled()
isManagementEnabled in interface javax.cache.configuration.CompleteConfiguration<K,V>public javax.cache.configuration.CompleteConfiguration<K,V> setManagementEnabled(boolean enabled)
CacheManager.enableManagement(String, boolean).enabled - true to enable statistics, false to disable.CacheConfigpublic javax.cache.configuration.Factory<javax.cache.integration.CacheLoader<K,V>> getCacheLoaderFactory()
getCacheLoaderFactory in interface javax.cache.configuration.CompleteConfiguration<K,V>public javax.cache.configuration.Factory<javax.cache.integration.CacheWriter<? super K,? super V>> getCacheWriterFactory()
getCacheWriterFactory in interface javax.cache.configuration.CompleteConfiguration<K,V>public javax.cache.configuration.Factory<javax.cache.expiry.ExpiryPolicy> getExpiryPolicyFactory()
getExpiryPolicyFactory in interface javax.cache.configuration.CompleteConfiguration<K,V>public Class<K> getKeyType()
getKeyType in interface javax.cache.configuration.Configuration<K,V>public Class<V> getValueType()
getValueType in interface javax.cache.configuration.Configuration<K,V>public javax.cache.configuration.CompleteConfiguration<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 typeCacheConfigNullPointerException - should the key or value type be nullCacheManager.getCache(String, Class, Class)public boolean isStoreByValue()
isStoreByValue in interface javax.cache.configuration.Configuration<K,V>public javax.cache.configuration.CompleteConfiguration<K,V> setStoreByValue(boolean storeByValue)
storeByValue - true if store-by-value is required,
false for store-by-referenceCacheConfigprotected Set<javax.cache.configuration.CacheEntryListenerConfiguration<K,V>> createConcurrentSet()
Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.