123456789101112131415161718192021 |
- package com.usky.config.shiro;
- import org.apache.shiro.cache.Cache;
- import org.apache.shiro.cache.CacheException;
- import org.apache.shiro.cache.CacheManager;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.data.redis.core.RedisTemplate;
- /**
- *
- * @author laowo
- */
- public class MyRedisCacheManager implements CacheManager {
- @Autowired
- private RedisTemplate redisTemplate;
- @Override
- public <K, V> Cache<K, V> getCache(String name) throws CacheException {
- return new ShiroRedisCache(name,redisTemplate);
- }
- }
|