Package io.micronaut.cache.discovery
Class DiscoveryClientCacheConfiguration
java.lang.Object
io.micronaut.cache.CacheConfiguration
io.micronaut.cache.discovery.DiscoveryClientCacheConfiguration
- All Implemented Interfaces:
io.micronaut.core.util.Toggleable
@Named("discovery-client")
@ConfigurationProperties("micronaut.caches.discovery-client")
@Requires(property="micronaut.caches.discovery-client.enabled",
notEquals="false")
public class DiscoveryClientCacheConfiguration
extends CacheConfiguration
implements io.micronaut.core.util.Toggleable
A cache configuration for the Discovery client cache.
- Since:
- 1.0
- Author:
- Graeme Rocher
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The prefix to use for all discovery client settings.static final boolean
The default enable value.static final String
Configuration property name for enabled discovery cache client.Fields inherited from class io.micronaut.cache.CacheConfiguration
charset, DEFAULT_RECORD_STATS, DEFAULT_TESTMODE, PREFIX
-
Constructor Summary
ConstructorDescriptionDiscoveryClientCacheConfiguration
(io.micronaut.runtime.ApplicationConfiguration applicationConfiguration) -
Method Summary
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
-
Field Details
-
CACHE_NAME
The prefix to use for all discovery client settings.- See Also:
-
SETTING_ENABLED
Configuration property name for enabled discovery cache client.- See Also:
-
DEFAULT_ENABLED
public static final boolean DEFAULT_ENABLEDThe default enable value.- See Also:
-
-
Constructor Details
-
DiscoveryClientCacheConfiguration
public DiscoveryClientCacheConfiguration(io.micronaut.runtime.ApplicationConfiguration applicationConfiguration) - Parameters:
applicationConfiguration
- The application configuration
-
-
Method Details
-
isEnabled
public boolean isEnabled()Default value (true).- Specified by:
isEnabled
in interfaceio.micronaut.core.util.Toggleable
- Returns:
- Whether the discovery client is enabled
-
setEnabled
public void setEnabled(boolean enabled) - Parameters:
enabled
- Enable or disable the discovery client
-