@EnableAspectJAutoProxy
@Configuration
@Import(value={org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration.class,org.springframework.boot.autoconfigure.aop.AopAutoConfiguration.class})
@EnableConfigurationProperties(value=L2CacheProperties.class)
public class L2CacheAutoConfiguration
extends Object
| 构造器和说明 |
|---|
L2CacheAutoConfiguration() |
| 限定符和类型 | 方法和说明 |
|---|---|
CacheNullCacheStrategy |
cacheNull2CacheStrategy()
缓存空值策略
|
(专用程序包) org.springframework.data.redis.listener.RedisMessageListenerContainer |
container(org.springframework.data.redis.connection.RedisConnectionFactory connectionFactory)
RedisMessageListenerContainer
|
org.springframework.aop.support.DefaultPointcutAdvisor |
defaultPointcutAdvisor(L2CacheInterceptor l2CacheInterceptor)
aop
|
L2CacheInterceptor |
l2CacheInterceptor(org.springframework.data.redis.core.StringRedisTemplate stringRedisTemplate,
L2CacheProperties l2CacheProperties) |
L2CacheKeyExpirationListener |
l2KeyExpirationListener(org.springframework.data.redis.listener.RedisMessageListenerContainer redisMessageListenerContainer)
过期key处理
|
NotCacheNullCacheStrategy |
notCacheNull2CacheStrategy()
不缓存空值策略
|
@Bean public NotCacheNullCacheStrategy notCacheNull2CacheStrategy()
@Bean public CacheNullCacheStrategy cacheNull2CacheStrategy()
@Bean org.springframework.data.redis.listener.RedisMessageListenerContainer container(org.springframework.data.redis.connection.RedisConnectionFactory connectionFactory)
connectionFactory - RedisConnectionFactory@ConditionalOnMissingBean(value=L2CacheKeyExpirationListener.class) @Bean public L2CacheKeyExpirationListener l2KeyExpirationListener(org.springframework.data.redis.listener.RedisMessageListenerContainer redisMessageListenerContainer)
redisMessageListenerContainer - redis container@Bean(name="l2CacheInterceptor") public L2CacheInterceptor l2CacheInterceptor(org.springframework.data.redis.core.StringRedisTemplate stringRedisTemplate, L2CacheProperties l2CacheProperties)
@Bean public org.springframework.aop.support.DefaultPointcutAdvisor defaultPointcutAdvisor(L2CacheInterceptor l2CacheInterceptor)
l2CacheInterceptor - 二级缓存拦截器Copyright © 2023. All rights reserved.