Class JCacheXProperties
- java.lang.Object
-
- io.github.dhruv1110.jcachex.spring.configuration.JCacheXProperties
-
@ConfigurationProperties(prefix="jcachex") public class JCacheXProperties extends Object
Configuration properties for JCacheX in Spring Boot applications. This class provides type-safe configuration binding for JCacheX cache settings through Spring Boot's configuration properties mechanism. It allows you to configure cache behavior through application.yml, application.properties, or environment variables.Application Properties Examples:
YAML Configuration:
jcachex: default: maximumSize: 1000 expireAfterSeconds: 1800 # 30 minutes enableStatistics: true enableJmx: false caches: users: maximumSize: 5000 expireAfterSeconds: 3600 # 1 hour enableStatistics: true enableJmx: true sessions: maximumSize: 10000 expireAfterSeconds: 1800 # 30 minutes enableStatistics: false apiResponses: maximumSize: 2000 expireAfterSeconds: 300 # 5 minutes enableStatistics: true
Properties File Configuration:
# Default cache configuration jcachex.default.maximumSize=1000 jcachex.default.expireAfterSeconds=1800 jcachex.default.enableStatistics=true jcachex.default.enableJmx=false # Named cache configurations jcachex.caches.users.maximumSize=5000 jcachex.caches.users.expireAfterSeconds=3600 jcachex.caches.users.enableStatistics=true jcachex.caches.sessions.maximumSize=10000 jcachex.caches.sessions.expireAfterSeconds=1800 jcachex.caches.sessions.enableStatistics=false
- Since:
- 1.0.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JCacheXProperties.CacheConfig
Configuration for individual cache instances.static class
JCacheXProperties.ConsulDiscoveryConfig
Configuration for Consul node discovery.static class
JCacheXProperties.DistributedConfig
Configuration for distributed cache functionality.static class
JCacheXProperties.EventListenersConfig
Configuration for cache event listeners.static class
JCacheXProperties.GossipDiscoveryConfig
Configuration for Gossip protocol node discovery.static class
JCacheXProperties.KubernetesDiscoveryConfig
Configuration for Kubernetes node discovery.static class
JCacheXProperties.NetworkConfig
Configuration for network-related settings.static class
JCacheXProperties.NodeDiscoveryConfig
Configuration for node discovery in distributed caches.static class
JCacheXProperties.ObservabilityConfig
Configuration for observability features (metrics, monitoring).static class
JCacheXProperties.ResilienceConfig
Configuration for resilience features (circuit breaker, retry policy).
-
Constructor Summary
Constructors Constructor Description JCacheXProperties()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,JCacheXProperties.CacheConfig>
getCaches()
JCacheXProperties.CacheConfig
getDefault()
Gets the default configuration using the property name "default".JCacheXProperties.CacheConfig
getDefaultConfig()
boolean
isAutoCreateCaches()
boolean
isEnabled()
void
setAutoCreateCaches(boolean autoCreateCaches)
void
setCaches(Map<String,JCacheXProperties.CacheConfig> caches)
void
setDefault(JCacheXProperties.CacheConfig defaultConfig)
Sets the default configuration using the property name "default".void
setDefaultConfig(JCacheXProperties.CacheConfig defaultConfig)
void
setEnabled(boolean enabled)
-
-
-
Method Detail
-
getDefaultConfig
public JCacheXProperties.CacheConfig getDefaultConfig()
-
setDefaultConfig
public void setDefaultConfig(JCacheXProperties.CacheConfig defaultConfig)
-
getDefault
public JCacheXProperties.CacheConfig getDefault()
Gets the default configuration using the property name "default". This enables property binding for "jcachex.default.*" properties.- Returns:
- the default cache configuration
-
setDefault
public void setDefault(JCacheXProperties.CacheConfig defaultConfig)
Sets the default configuration using the property name "default". This enables property binding for "jcachex.default.*" properties.- Parameters:
defaultConfig
- the default cache configuration
-
getCaches
public Map<String,JCacheXProperties.CacheConfig> getCaches()
-
setCaches
public void setCaches(Map<String,JCacheXProperties.CacheConfig> caches)
-
isEnabled
public boolean isEnabled()
-
setEnabled
public void setEnabled(boolean enabled)
-
isAutoCreateCaches
public boolean isAutoCreateCaches()
-
setAutoCreateCaches
public void setAutoCreateCaches(boolean autoCreateCaches)
-
-