Class CaffeineCacheConfiguration
- java.lang.Object
-
- io.micronaut.cache.CacheConfiguration
-
- io.micronaut.cache.caffeine.configuration.CaffeineCacheConfiguration
-
- Direct Known Subclasses:
DefaultCacheConfiguration
public class CaffeineCacheConfiguration extends io.micronaut.cache.CacheConfigurationDefault cache configuration implementation used to configure instances ofDefaultSyncCache.- Since:
- 1.0.2
-
-
Constructor Summary
Constructors Constructor Description CaffeineCacheConfiguration(java.lang.String cacheName, io.micronaut.runtime.ApplicationConfiguration applicationConfiguration)Creates a new cache with the given name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisListenToEvictions()If a removal listener is defined and this property is true then caffeine will send eviction events to that listener.booleanisListenToRemovals()If a removal listener is defined and this property is true then caffeine will send removal events to that listener.voidsetListenToEvictions(boolean listenToEvictions)voidsetListenToRemovals(boolean listenToRemovals)-
Methods inherited from class io.micronaut.cache.CacheConfiguration
getCacheName, getCharset, getExpireAfterAccess, getExpireAfterWrite, getInitialCapacity, getMaximumSize, getMaximumWeight, isRecordStats, isTestMode, setCharset, setExpireAfterAccess, setExpireAfterWrite, setInitialCapacity, setMaximumSize, setMaximumWeight, setRecordStats, setTestMode
-
-
-
-
Constructor Detail
-
CaffeineCacheConfiguration
public CaffeineCacheConfiguration(@Parameter java.lang.String cacheName, io.micronaut.runtime.ApplicationConfiguration applicationConfiguration)Creates a new cache with the given name.- Parameters:
cacheName- Name or key of the cacheapplicationConfiguration- The common application configuration
-
-
Method Detail
-
isListenToRemovals
public boolean isListenToRemovals()
If a removal listener is defined and this property is true then caffeine will send removal events to that listener.- Returns:
- True if listen to removals is enabled
-
setListenToRemovals
public void setListenToRemovals(boolean listenToRemovals)
- Parameters:
listenToRemovals- The listen to removals flag.
-
isListenToEvictions
public boolean isListenToEvictions()
If a removal listener is defined and this property is true then caffeine will send eviction events to that listener.- Returns:
- True if listen to evictions is enabled
-
setListenToEvictions
public void setListenToEvictions(boolean listenToEvictions)
- Parameters:
listenToEvictions- The listen to evictions flag.
-
-