com.clickntap.tool.cache.EhCacheManager Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of click_framework Show documentation
Show all versions of click_framework Show documentation
Java Framework based on Spring Framework, Freemarker and Simplicity
The newest version!
package com.clickntap.tool.cache;
import java.util.Arrays;
import java.util.List;
public class EhCacheManager implements CacheManager {
private net.sf.ehcache.CacheManager cacheManager;
public EhCacheManager() {
cacheManager = net.sf.ehcache.CacheManager.create();
}
public Cache getCache(String cacheName, int maxSize) throws Exception {
return new EhCache(cacheManager, cacheName, maxSize);
}
public boolean containsCache(String cacheName) {
return cacheManager.cacheExists(cacheName);
}
public void reset() {
cacheManager.clearAll();
}
public void shutdown() {
cacheManager.shutdown();
}
public List getCacheNames() throws Exception {
return Arrays.asList(cacheManager.getCacheNames());
}
}