Class CodecRedisCacheAutoConfiguration
java.lang.Object
org.jwcarman.codec.autoconfigure.CodecRedisCacheAutoConfiguration
@AutoConfiguration(after={ForyCodecAutoConfiguration.class,JacksonCodecAutoConfiguration.class,Jackson2CodecAutoConfiguration.class,GsonCodecAutoConfiguration.class,JsonbCodecAutoConfiguration.class,ProtobufCodecAutoConfiguration.class},
before=org.springframework.boot.cache.autoconfigure.CacheAutoConfiguration.class)
@ConditionalOnClass({CodecRedisSerializer.class,org.springframework.data.redis.cache.RedisCacheConfiguration.class,org.springframework.boot.cache.autoconfigure.RedisCacheManagerBuilderCustomizer.class})
@ConditionalOnBean(CodecFactory.class)
@ConditionalOnBooleanProperty(name="codec.redis.cache.enabled",
matchIfMissing=true)
@EnableConfigurationProperties(CodecRedisCacheProperties.class)
public class CodecRedisCacheAutoConfiguration
extends Object
Serializes Redis cache values through the application's
CodecFactory. Runs after the
backend auto-configurations, so the factory they register is the one used, and before Spring
Boot's cache auto-configuration, which collects the RedisCacheManagerBuilderCustomizer
registered here. The customizer keeps every other cache setting — TTL, key prefix, key serializer
— from Boot's defaults and replaces only the value serializer, for the caches named in CodecRedisCacheProperties.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.boot.cache.autoconfigure.RedisCacheManagerBuilderCustomizercodecRedisCacheManagerBuilderCustomizer(CodecFactory factory, CodecRedisCacheProperties properties) Customizes the Redis cache manager so cache values are serialized through the codec factory.
-
Constructor Details
-
CodecRedisCacheAutoConfiguration
public CodecRedisCacheAutoConfiguration()Creates the auto-configuration.
-
-
Method Details
-
codecRedisCacheManagerBuilderCustomizer
@Bean public org.springframework.boot.cache.autoconfigure.RedisCacheManagerBuilderCustomizer codecRedisCacheManagerBuilderCustomizer(CodecFactory factory, CodecRedisCacheProperties properties) Customizes the Redis cache manager so cache values are serialized through the codec factory.- Parameters:
factory- the codec factory that serializes cache valuesproperties- thecodec.redis.cachesettings- Returns:
- the customizer
-