@Configuration
@ConditionalOnProperty(prefix="ums.cache.redis",
name="open",
havingValue="true")
@EnableCaching
public class RedisCacheAutoConfiguration
extends Object
CacheManager, 向 IOC 容器中注入 beanName=auth2RedisHashCacheManager 的实例. RedisCache 进行了修改, 把缓存的 KV 格式该成了 Hash 格式.CacheErrorHandler 注入 IOC 容器即可自动注入 CachingConfigurerSupport,
当然也可自定义 CachingConfigurerSupport .| 限定符和类型 | 字段和说明 |
|---|---|
static org.slf4j.Logger |
log |
static String |
REDIS_CACHE_HASH_KEY_SEPARATE
redis cache 解析Key:根据分隔符 "__" 来判断是否是 hash 类型
|
static String |
REDIS_CACHE_KEY_SEPARATE |
| 构造器和说明 |
|---|
RedisCacheAutoConfiguration(RedisCacheProperties redisCacheProperties,
org.springframework.boot.autoconfigure.data.redis.RedisProperties properties,
org.springframework.beans.factory.ObjectProvider<org.springframework.data.redis.connection.RedisSentinelConfiguration> sentinelConfigurationProvider,
org.springframework.beans.factory.ObjectProvider<org.springframework.data.redis.connection.RedisClusterConfiguration> clusterConfigurationProvider,
Map<String,SimpleModuleHolder> jackson2ModuleHolderMap) |
| 限定符和类型 | 方法和说明 |
|---|---|
org.springframework.cache.interceptor.CacheErrorHandler |
cacheErrorHandler() |
org.springframework.cache.annotation.CachingConfigurerSupport |
cachingConfigurerSupport(org.springframework.cache.interceptor.CacheErrorHandler cacheErrorHandler) |
protected org.springframework.data.redis.connection.RedisClusterConfiguration |
getClusterConfiguration()
Create a
RedisClusterConfiguration if necessary. |
protected org.springframework.boot.autoconfigure.data.redis.RedisProperties |
getProperties() |
protected org.springframework.data.redis.connection.RedisSentinelConfiguration |
getSentinelConfig() |
protected org.springframework.data.redis.connection.RedisStandaloneConfiguration |
getStandaloneConfig() |
protected top.dcenter.ums.security.core.redis.config.RedisCacheAutoConfiguration.ConnectionInfo |
parseUrl(String url) |
org.springframework.cache.CacheManager |
redisCacheManager(org.springframework.data.redis.connection.RedisConnectionFactory redisConnectionFactory,
org.springframework.beans.factory.ObjectProvider<org.springframework.boot.autoconfigure.data.redis.LettuceClientConfigurationBuilderCustomizer> builderCustomizers,
io.lettuce.core.resource.ClientResources clientResources)
缓存管理器, 当 IOC 容器中有 beanName=auth2RedisHashCacheManager 时会替换此实例
|
RemoveConnectionsByConnectionKeyWithUserIdKeyGenerator |
removeConnectionsByConnectionKeyWithUserIdKeyGenerator() |
public static final org.slf4j.Logger log
public static final String REDIS_CACHE_HASH_KEY_SEPARATE
public RedisCacheAutoConfiguration(RedisCacheProperties redisCacheProperties, org.springframework.boot.autoconfigure.data.redis.RedisProperties properties, org.springframework.beans.factory.ObjectProvider<org.springframework.data.redis.connection.RedisSentinelConfiguration> sentinelConfigurationProvider, org.springframework.beans.factory.ObjectProvider<org.springframework.data.redis.connection.RedisClusterConfiguration> clusterConfigurationProvider, @Autowired(required=false) Map<String,SimpleModuleHolder> jackson2ModuleHolderMap)
@Bean(value="auth2RedisHashCacheManager")
@ConditionalOnMissingBean(name="auth2RedisHashCacheManager")
public org.springframework.cache.CacheManager redisCacheManager(org.springframework.data.redis.connection.RedisConnectionFactory redisConnectionFactory,
org.springframework.beans.factory.ObjectProvider<org.springframework.boot.autoconfigure.data.redis.LettuceClientConfigurationBuilderCustomizer> builderCustomizers,
io.lettuce.core.resource.ClientResources clientResources)
@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)
protected final org.springframework.data.redis.connection.RedisStandaloneConfiguration getStandaloneConfig()
protected final org.springframework.data.redis.connection.RedisSentinelConfiguration getSentinelConfig()
protected final org.springframework.data.redis.connection.RedisClusterConfiguration getClusterConfiguration()
RedisClusterConfiguration if necessary.protected final org.springframework.boot.autoconfigure.data.redis.RedisProperties getProperties()
protected top.dcenter.ums.security.core.redis.config.RedisCacheAutoConfiguration.ConnectionInfo parseUrl(String url)
Copyright © 2021. All rights reserved.