All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.clickntap.tool.cache.MemoryCacheManager Maven / Gradle / Ivy

There is a newer version: 1.30
Show newest version
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();
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy