Improve RedisCacheManagerBuilder to expose applied RedisCacheConfiguration.
Now it is possible to construct a new, custom default RedisCacheConfiguration from an existing, default RedisCacheConfiguration. This is useful in a Spring Boot context using the RedisCacheManagerBuilderCustomizer and acquiring access to the default RedisCacheConfiguration, which likely originated from Spring Boot Redis CacheProperties. Resolves #2583
This commit is contained in:
@@ -41,6 +41,7 @@ import org.springframework.util.Assert;
|
||||
*
|
||||
* @author Christoph Strobl
|
||||
* @author Mark Paluch
|
||||
* @author Yanming Zhou
|
||||
* @since 2.0
|
||||
* @see RedisCacheConfiguration
|
||||
* @see RedisCacheWriter
|
||||
@@ -336,6 +337,15 @@ public class RedisCacheManager extends AbstractTransactionSupportingCacheManager
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns applied {@link RedisCacheConfiguration}, allow customization base on it.
|
||||
*
|
||||
* @return applied {@link RedisCacheConfiguration}.
|
||||
*/
|
||||
public RedisCacheConfiguration cacheDefaults() {
|
||||
return this.defaultCacheConfiguration;
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure a {@link RedisCacheWriter}.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user