类 RedisAutoConfigure
java.lang.Object
top.tangyh.basic.cache.RedisAutoConfigure
@ConditionalOnClass(org.springframework.data.redis.connection.RedisConnectionFactory.class)
@ConditionalOnProperty(prefix="lamp.cache",
name="type",
havingValue="REDIS",
matchIfMissing=true)
@EnableConfigurationProperties({org.springframework.boot.autoconfigure.data.redis.RedisProperties.class,CustomCacheProperties.class})
public class RedisAutoConfigure
extends Object
redis 配置类
- 作者:
- zuihou
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明org.springframework.cache.CacheManagercacheManager(org.springframework.data.redis.connection.RedisConnectionFactory redisConnectionFactory) 用于 @Cacheable 相关注解redis 持久库cachePlusOps(RedisOps redisOps) redis 增强持久库getRedisOps(org.springframework.data.redis.core.RedisTemplate<String, Object> redisTemplate, org.springframework.data.redis.core.StringRedisTemplate stringRedisTemplate) redisDistributedLock(org.springframework.data.redis.core.RedisTemplate<String, Object> redisTemplate) 分布式锁org.springframework.data.redis.serializer.RedisSerializer<Object>redisTemplate(org.springframework.data.redis.connection.RedisConnectionFactory factory, org.springframework.data.redis.serializer.RedisSerializer<Object> redisSerializer) RedisTemplate配置org.springframework.data.redis.core.StringRedisTemplatestringRedisTemplate(org.springframework.data.redis.connection.RedisConnectionFactory factory)
-
构造器详细资料
-
RedisAutoConfigure
public RedisAutoConfigure()
-
-
方法详细资料
-
redisDistributedLock
@Bean @ConditionalOnMissingBean public DistributedLock redisDistributedLock(@Qualifier("redisTemplate") org.springframework.data.redis.core.RedisTemplate<String, Object> redisTemplate) 分布式锁- 参数:
redisTemplate- redis- 返回:
- 分布式锁
-
redisTemplate
@Bean("redisTemplate") public org.springframework.data.redis.core.RedisTemplate<String,Object> redisTemplate(org.springframework.data.redis.connection.RedisConnectionFactory factory, org.springframework.data.redis.serializer.RedisSerializer<Object> redisSerializer) RedisTemplate配置- 参数:
factory- redis链接工厂
-
redisSerializer
@Bean @ConditionalOnMissingBean(org.springframework.data.redis.serializer.RedisSerializer.class) public org.springframework.data.redis.serializer.RedisSerializer<Object> redisSerializer() -
stringRedisTemplate
@Bean("stringRedisTemplate") public org.springframework.data.redis.core.StringRedisTemplate stringRedisTemplate(org.springframework.data.redis.connection.RedisConnectionFactory factory) -
cacheOps
redis 持久库- 参数:
redisOps- the redis template- 返回:
- the redis repository
-
cachePlusOps
redis 增强持久库- 参数:
redisOps- the redis template- 返回:
- the redis repository
-
cacheManager
@Bean(name="cacheManager") @Primary public org.springframework.cache.CacheManager cacheManager(org.springframework.data.redis.connection.RedisConnectionFactory redisConnectionFactory) 用于 @Cacheable 相关注解- 参数:
redisConnectionFactory- 链接工厂- 返回:
- 缓存管理器
-
getRedisOps
-