Package net.sf.ehcache

Examples of net.sf.ehcache.Cache.removeAll()


  public JSONObject flushCache(HttpSession session, JSONObject json) {
    if (json.has("cache") && !"".equals(json.getString("cache"))) {
      String cacheName = json.getString("cache");
      Cache cache = cacheManager.getCache(cacheName);
      if (cache != null) {
        cache.removeAll();
        log.info("Cache '"+cacheName+"' flushed!");
      }
      else {
        return JSONUtils.SimpleJSONError("No such cache: " + cacheName);
      }
View Full Code Here


            @PathVariable("cacheName") String cacheName
    ) {

        Cache cache = cacheManager.getCache(cacheName);
        cache.clearStatistics();
        cache.removeAll();

        return "操作成功!";

    }
View Full Code Here

    }

    public void clear() {
        CacheManager cacheManager = CacheManager.getInstance();
        Cache cache = cacheManager.getCache("generalUseCache");
        cache.removeAll();
    }
}
View Full Code Here

   * @param cacheName
   */
  public void clearCache(String cacheName) {
    Cache cache = this.cacheManager.getCache(cacheName);
    if(null != cache && Status.STATUS_ALIVE.equals(cache.getStatus())) {
      cache.removeAll();
      logger.warn("finished removeAll for cache: " + cacheName);
    }
  }
 
  /**
 
View Full Code Here

        List<String> keys = cache.getKeys();
        logger.info(keys.size() + " cached records cleared");
        if (logger.isDebugEnabled()) {
            logger.debug("[" + StringUtils.join(keys, ",") + "]");
        }
        cache.removeAll();
    }

    /*
     * (non-Javadoc)
     *
 
View Full Code Here

  public void run() {

    // Clear all existing cache elements
    for (String cacheName : _cacheManager.getCacheNames()) {
      Cache cache = _cacheManager.getCache(cacheName);
      cache.removeAll();
    }

    try {
      List<AgencyWithCoverageBean> agenciesWithCoverage = _service.getAgenciesWithCoverage();
View Full Code Here

  public static void clear(CacheManager cacheManager, String cacheName) {
    ArgumentChecker.notNull(cacheManager, "cacheManager");
    ArgumentChecker.notNull(cacheName, "cacheName");
    Cache cache = cacheManager.getCache(cacheName);
    if (cache != null) {
      cache.removeAll();
    }
  }

  /**
   * Adds a cache to the cache manager if necessary.
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.