@Configuration
@ConditionalOnBean(value=org.springframework.data.redis.connection.RedisConnectionFactory.class)
@ConditionalOnMissingBean(value=org.springframework.data.redis.core.RedisTemplate.class)
public class CacheManagerConfig
extends org.springframework.cache.annotation.CachingConfigurerSupport
| 构造器和说明 |
|---|
CacheManagerConfig() |
| 限定符和类型 | 方法和说明 |
|---|---|
org.springframework.cache.CacheManager |
cacheManager(org.springframework.data.redis.connection.RedisConnectionFactory factory) |
org.springframework.cache.interceptor.KeyGenerator |
keyGenerator() |
org.springframework.data.redis.core.RedisTemplate |
redisTemplate(org.springframework.data.redis.connection.RedisConnectionFactory factory) |
@Bean public org.springframework.cache.interceptor.KeyGenerator keyGenerator()
keyGenerator 在接口中 org.springframework.cache.annotation.CachingConfigurerkeyGenerator 在类中 org.springframework.cache.annotation.CachingConfigurerSupport@Bean public org.springframework.data.redis.core.RedisTemplate redisTemplate(org.springframework.data.redis.connection.RedisConnectionFactory factory)
@Bean public org.springframework.cache.CacheManager cacheManager(org.springframework.data.redis.connection.RedisConnectionFactory factory)
Copyright © 2020. All rights reserved.