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

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

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());
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy