com.clickntap.tool.cache.MemoryCacheManager Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of Stripecube Show documentation
Show all versions of Stripecube Show documentation
Stripecube is an open source Java framework for Web Applications
package com.clickntap.tool.cache;
import java.util.HashMap;
public class MemoryCacheManager implements CacheManager {
private HashMap caches;
public MemoryCacheManager() {
caches = new HashMap();
}
public Cache getCache(String cacheName) throws Exception {
synchronized (caches) {
if (!caches.containsKey(cacheName))
caches.put(cacheName, new MemoryCache());
return caches.get(cacheName);
}
}
public boolean containsCache(String cacheName) {
return true;
}
public void reset() {
synchronized (caches) {
caches = new HashMap();
}
}
}