@Configuration
@ConditionalOnProperty(prefix="ums.cache.redis",
name="open",
havingValue="true")
@EnableCaching
public class RedisCacheAutoConfiguration
extends Object
CacheManager, 向 IOC 容器中注入 beanName=socialRedisHashCacheManager 的实例. RedisCache 进行了修改, 把缓存的 KV 格式该成了 Hash 格式.CacheErrorHandler 注入 IOC 容器即可自动注入 CachingConfigurerSupport,
当然也可自定义 CachingConfigurerSupport .| 限定符和类型 | 字段和说明 |
|---|---|
static String |
REDIS_CACHE_HASH_KEY_SEPARATE
redis cache 解析Key:根据分隔符 "__" 来判断是否是 hash 类型
|
static String |
REDIS_CACHE_KEY_SEPARATE |
static String |
USER_CONNECTION_CACHE_NAME
第三方授权登录信息 kv 缓存
|
static String |
USER_CONNECTION_HASH_ALL_CLEAR_CACHE_NAME
第三方授权登录信息 hash 缓存, 当清除缓存时模糊清除, 用按 hash key 清除.
|
static String |
USER_CONNECTION_HASH_CACHE_NAME
第三方授权登录信息 hash 缓存, 当清除缓存时精确清除, 用按 hash key field 清除.
|
| 构造器和说明 |
|---|
RedisCacheAutoConfiguration(RedisCacheProperties redisCacheProperties,
org.springframework.boot.autoconfigure.data.redis.RedisProperties redisProperties) |
| 限定符和类型 | 方法和说明 |
|---|---|
org.springframework.cache.interceptor.CacheErrorHandler |
cacheErrorHandler() |
org.springframework.cache.annotation.CachingConfigurerSupport |
cachingConfigurerSupport(org.springframework.cache.interceptor.CacheErrorHandler cacheErrorHandler) |
org.springframework.cache.CacheManager |
redisCacheManager(org.springframework.data.redis.connection.RedisConnectionFactory redisConnectionFactory)
缓存管理器, 当 IOC 容器中有 beanName=redisCacheManager 时会替换此实例
|
RemoveConnectionsByConnectionKeyWithUserIdKeyGenerator |
removeConnectionsByConnectionKeyWithUserIdKeyGenerator() |
public static final String REDIS_CACHE_HASH_KEY_SEPARATE
public static final String USER_CONNECTION_CACHE_NAME
public static final String USER_CONNECTION_HASH_CACHE_NAME
public RedisCacheAutoConfiguration(RedisCacheProperties redisCacheProperties, org.springframework.boot.autoconfigure.data.redis.RedisProperties redisProperties)
@Bean(value="auth2RedisHashCacheManager") @ConditionalOnMissingBean(name="auth2RedisHashCacheManager") public org.springframework.cache.CacheManager redisCacheManager(org.springframework.data.redis.connection.RedisConnectionFactory redisConnectionFactory)
@Bean(value="removeConnectionsByConnectionKeyWithUserIdKeyGenerator") public RemoveConnectionsByConnectionKeyWithUserIdKeyGenerator removeConnectionsByConnectionKeyWithUserIdKeyGenerator()
@Bean @ConditionalOnMissingBean(type="org.springframework.cache.interceptor.CacheErrorHandler") public org.springframework.cache.interceptor.CacheErrorHandler cacheErrorHandler()
@Bean @ConditionalOnMissingBean(type="org.springframework.cache.annotation.CachingConfigurerSupport") public org.springframework.cache.annotation.CachingConfigurerSupport cachingConfigurerSupport(org.springframework.cache.interceptor.CacheErrorHandler cacheErrorHandler)
Copyright © 2021. All rights reserved.