package com.yeshi.buwan.util; import net.sf.ehcache.Cache; import net.sf.ehcache.CacheManager; import net.sf.ehcache.config.CacheConfiguration; public class EhcacheUtil { public static CacheManager cacheManager = CacheManager.getInstance(); public static Cache addCahae(CacheConfiguration cacheConfiguration){ cacheManager.addCache(new Cache(cacheConfiguration)); return cacheManager.getCache(cacheConfiguration.getName()); } public static void removeCache(String name){ cacheManager.removeCache(name); } public static Cache getCache(String name){ return cacheManager.getCache(name); } }