package com.nuliji.tools.shiro.cache;

import org.apache.shiro.cache.Cache;
import org.apache.shiro.cache.CacheException;
import org.apache.shiro.util.Destroyable;

/**
 * Created by gaojie on 2017/11/7.
 */
public class CustomCacheManager implements org.apache.shiro.cache.CacheManager {
    private CacheProvider cacheProvider;
    public CacheProvider getCacheProvider() {
        return cacheProvider;
    }
    public void setCacheProvider(CacheProvider cacheProvider) {
        this.cacheProvider = cacheProvider;
    }
//    @Override
//    public void destroy() throws Exception {
//        getCacheProvider().destroy();
//    }
    @Override
    public <k, v> Cache<k, v> getCache(String name) throws CacheException {
        return getCacheProvider().getCache(name);
    }
}
