Package io.micronaut.eclipsestore.cache
Class EclipseStoreCacheConfigurationProperties<K,V>
java.lang.Object
io.micronaut.eclipsestore.cache.EclipseStoreCacheConfigurationProperties<K,V>
- Type Parameters:
K
- Key TypeV
- Value Type
- All Implemented Interfaces:
io.micronaut.core.naming.Named
,io.micronaut.core.util.Toggleable
,EclipseStoreCacheConfiguration<K,
V>
@EachProperty("eclipsestore.cache")
public class EclipseStoreCacheConfigurationProperties<K,V>
extends Object
implements EclipseStoreCacheConfiguration<K,V>
- Since:
- 1.3.0
- Author:
- Sergio del Amo
-
Field Summary
Modifier and TypeFieldDescriptionstatic final boolean
Whether this cache is enabled by default.static final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription@NonNull String
getName()
@Nullable String
boolean
@Nullable Boolean
Whether management is enabled on this cache.@Nullable Boolean
When in "read-through" mode, cache misses that occur due to cache entries not existing as a result of performing a "get" will appropriately cause the configured CacheLoader to be invoked.@Nullable Boolean
Whether statistics collection is enabled in this cache.@Nullable Boolean
When a cache is storeByValue, any mutation to the key or value does not affect the key of value stored in the cache.@Nullable Boolean
When in "write-through" mode, cache updates that occur as a result of performing "put" operations will appropriately cause the configured CacheWriter to be invoked.void
setEnabled
(boolean enabled) Whether this cache is enabled.void
setKeyType
(@Nullable Class<K> keyType) void
setManagementEnabled
(Boolean managementEnabled) Whether management is enabled on this cache.void
setReadThrough
(Boolean readThrough) When in "read-through" mode, cache misses that occur due to cache entries not existing as a result of performing a "get" will appropriately cause the configured CacheLoader to be invoked.void
setStatisticsEnabled
(Boolean statisticsEnabled) Whether statistics collection is enabled in this cache.void
setStorage
(@Nullable String storage) void
setStoreByValue
(Boolean storeByValue) When a cache is storeByValue, any mutation to the key or value does not affect the key of value stored in the cache.void
setValueType
(@Nullable Class<V> valueType) void
setWriteThrough
(Boolean writeThrough) When in "write-through" mode, cache updates that occur as a result of performing "put" operations will appropriately cause the configured CacheWriter to be invoked.When you set a Storage Manager, "write-through" mode is activated.
-
Field Details
-
PREFIX
- See Also:
-
DEFAULT_ENABLED
public static final boolean DEFAULT_ENABLEDWhether this cache is enabled by default.- See Also:
-
-
Constructor Details
-
EclipseStoreCacheConfigurationProperties
-
-
Method Details
-
getKeyType
- Specified by:
getKeyType
in interfaceEclipseStoreCacheConfiguration<K,
V> - Returns:
- The required type of keys for the Cache.
-
setKeyType
- Parameters:
keyType
- The required type of keys for the Cache.
-
getValueType
- Specified by:
getValueType
in interfaceEclipseStoreCacheConfiguration<K,
V> - Returns:
- Determines type of values for the Cache.
-
setValueType
- Parameters:
valueType
- Determines type of values for the Cache.
-
getStorage
- Specified by:
getStorage
in interfaceEclipseStoreCacheConfiguration<K,
V> - Returns:
- Name qualifier for Storage Manager.
-
setStorage
- Parameters:
storage
- Name qualifier for EclipseStore Storage Manager
-
isReadThrough
Description copied from interface:EclipseStoreCacheConfiguration
When in "read-through" mode, cache misses that occur due to cache entries not existing as a result of performing a "get" will appropriately cause the configured CacheLoader to be invoked.- Specified by:
isReadThrough
in interfaceEclipseStoreCacheConfiguration<K,
V> - Returns:
- Whether to use "read-through" mode
-
isWriteThrough
Description copied from interface:EclipseStoreCacheConfiguration
When in "write-through" mode, cache updates that occur as a result of performing "put" operations will appropriately cause the configured CacheWriter to be invoked.- Specified by:
isWriteThrough
in interfaceEclipseStoreCacheConfiguration<K,
V> - Returns:
- Whether to use "write-through" mode.
-
isStoreByValue
Description copied from interface:EclipseStoreCacheConfiguration
When a cache is storeByValue, any mutation to the key or value does not affect the key of value stored in the cache.- Specified by:
isStoreByValue
in interfaceEclipseStoreCacheConfiguration<K,
V> - Returns:
- Whether the cache is Story by value.
-
isStatisticsEnabled
Description copied from interface:EclipseStoreCacheConfiguration
Whether statistics collection is enabled in this cache.- Specified by:
isStatisticsEnabled
in interfaceEclipseStoreCacheConfiguration<K,
V> - Returns:
- Whether statistics collection is enabled in this cache.
-
isManagementEnabled
Description copied from interface:EclipseStoreCacheConfiguration
Whether management is enabled on this cache.- Specified by:
isManagementEnabled
in interfaceEclipseStoreCacheConfiguration<K,
V> - Returns:
- Whether management is enabled on this cache.
-
getName
- Specified by:
getName
in interfaceio.micronaut.core.naming.Named
-
setReadThrough
When in "read-through" mode, cache misses that occur due to cache entries not existing as a result of performing a "get" will appropriately cause the configured CacheLoader to be invoked. When you set a Storage Manager, "read-through" mode is activated.- Parameters:
readThrough
- Whether to use "read-through" mode
-
setWriteThrough
When in "write-through" mode, cache updates that occur as a result of performing "put" operations will appropriately cause the configured CacheWriter to be invoked.When you set a Storage Manager, "write-through" mode is activated.- Parameters:
writeThrough
- Whether to use "write-through" mode.
-
setStoreByValue
When a cache is storeByValue, any mutation to the key or value does not affect the key of value stored in the cache.- Parameters:
storeByValue
- When a cache is storeByValue, any mutation to the key or value does not affect the key of value stored in the cache.
-
setStatisticsEnabled
Whether statistics collection is enabled in this cache.- Parameters:
statisticsEnabled
- Whether statistics collection is enabled in this cache.
-
setManagementEnabled
Whether management is enabled on this cache.- Parameters:
managementEnabled
- Whether management is enabled on this cache.
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabled
in interfaceio.micronaut.core.util.Toggleable
-
setEnabled
public void setEnabled(boolean enabled) Whether this cache is enabled. Default Value: true- Parameters:
enabled
- Whether this cache is enabled.
-