提交 666e7e33 编写于 作者: ibizdev's avatar ibizdev

ibizdev提交

上级 95cd2be3
...@@ -4,12 +4,12 @@ import com.github.benmanes.caffeine.cache.Caffeine; ...@@ -4,12 +4,12 @@ import com.github.benmanes.caffeine.cache.Caffeine;
import com.github.benmanes.caffeine.cache.CaffeineSpec; import com.github.benmanes.caffeine.cache.CaffeineSpec;
import lombok.Data; import lombok.Data;
import cn.ibizlab.util.cache.cache.LayeringCache; import cn.ibizlab.util.cache.cache.LayeringCache;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.cache.Cache; import org.springframework.cache.Cache;
import org.springframework.cache.CacheManager; import org.springframework.cache.CacheManager;
import org.springframework.data.redis.cache.RedisCacheConfiguration; import org.springframework.data.redis.cache.RedisCacheConfiguration;
import org.springframework.data.redis.cache.RedisCacheWriter; import org.springframework.data.redis.cache.RedisCacheWriter;
import org.springframework.data.redis.core.RedisOperations;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
...@@ -36,7 +36,8 @@ public class LayeringCacheManager implements CacheManager { ...@@ -36,7 +36,8 @@ public class LayeringCacheManager implements CacheManager {
private final ConcurrentMap<String, Cache> cacheMap = new ConcurrentHashMap<String, Cache>(16); private final ConcurrentMap<String, Cache> cacheMap = new ConcurrentHashMap<String, Cache>(16);
public RedisCacheWriter redisCacheWriter; public RedisCacheWriter redisCacheWriter;
public RedisCacheConfiguration redisConfiguration; public RedisCacheConfiguration redisConfiguration;
public RedisOperations redisOperations; @Autowired
public RedisTemplate<String, Object> redisTemplate;
/** /**
* 缓存默认设置 * 缓存默认设置
...@@ -46,10 +47,6 @@ public class LayeringCacheManager implements CacheManager { ...@@ -46,10 +47,6 @@ public class LayeringCacheManager implements CacheManager {
.initialCapacity(DEFAULT_INITIAL_CAPACITY) .initialCapacity(DEFAULT_INITIAL_CAPACITY)
.maximumSize(DEFAULT_MAXIMUM_SIZE); .maximumSize(DEFAULT_MAXIMUM_SIZE);
public LayeringCacheManager(RedisTemplate<String, Object> redisTemplate) {
this.redisOperations=redisTemplate;
}
/** /**
* 获取缓存对象 * 获取缓存对象
* @param name * @param name
...@@ -76,7 +73,7 @@ public class LayeringCacheManager implements CacheManager { ...@@ -76,7 +73,7 @@ public class LayeringCacheManager implements CacheManager {
} }
protected Cache createCache(String name) { protected Cache createCache(String name) {
return new LayeringCache(name,this.redisOperations ,this.cacheBuilder.build(),redisCacheWriter,redisConfiguration); return new LayeringCache(name,redisTemplate,this.cacheBuilder.build(),redisCacheWriter,redisConfiguration);
} }
/** /**
......
...@@ -38,7 +38,7 @@ import java.util.concurrent.ConcurrentHashMap; ...@@ -38,7 +38,7 @@ import java.util.concurrent.ConcurrentHashMap;
public class RemoteService { public class RemoteService {
/** /**
* FeignClientFactoryBean 该工厂类中 设置builder属性时就是通过该对象,源码中可看到 * FeignClientFactoryBean
*/ */
@Autowired @Autowired
protected FeignContext feignContext; protected FeignContext feignContext;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册