group.rober.base.adapter.CacheManagerAdapter Maven / Gradle / Ivy
The newest version!
package group.rober.base.adapter;
import org.apache.shiro.cache.Cache;
import org.apache.shiro.cache.CacheException;
import org.apache.shiro.cache.CacheManager;
public class CacheManagerAdapter implements CacheManager{
private final org.springframework.cache.CacheManager cacheManager;
public CacheManagerAdapter(org.springframework.cache.CacheManager cacheManager) {
this.cacheManager = cacheManager;
}
@Override
public Cache getCache(String name) throws CacheException {
org.springframework.cache.Cache cache = cacheManager.getCache(name);
return new CacheAdapter<>(cache);
}
}