use of com.jn.agileway.redis.l2cache.RedisCacheContext in project agileway by fangjinuo.
the class ShiroRedisCacheManager method createCache.
@Override
protected Cache createCache(String cacheName) throws CacheException {
RedisKeyWrapper redisCacheKeyWrapper = new RedisKeyWrapper().prefix("shiro_redis:" + cacheName);
RedisCacheContext cacheContext = new RedisCacheContext();
cacheContext.setLoader(loader);
cacheContext.setRedisTemplate(redisTemplate);
cacheContext.setKeyWrapper(redisCacheKeyWrapper);
cacheContext.setRemoveListener(removeListener);
RedisCache redisCache = new RedisCacheFactory().get(cacheContext);
ShiroRedisCache shiroRedisCache = new ShiroRedisCache();
shiroRedisCache.setRedisCache(redisCache);
shiroRedisCache.setKeyCodec(keyCodec);
return shiroRedisCache;
}
Aggregations