Package net.sf.ehcache

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


        String cacheName = null;
        try {
          // delete cache
          Cache c = (Cache)dc.getUserObject();
          cacheName = c.getName();
          c.removeAll();
        } catch (IllegalStateException e) {
          // ignore
          log.error("Cannot remove Cache:"+cacheName, e);
        }
        // update tablemodel
View Full Code Here


   {
      String[] strings = cacheManager.getCacheNames();
      for (String cacheName : strings)
      {
         Cache cache = getCacheRegion(cacheName);
         cache.removeAll();
      }
   }

   @Override
   public Object get(String region, String key)
View Full Code Here

      int nameCount = cacheNames.length;

      try {
        for (int i = 0; i < nameCount; i++) {
          Cache cache = getCache(cacheNames[i]);
          cache.removeAll();
        }
      } catch (CacheException exception) {
        cacheException = exception;
      } catch (Exception exception) {
        cacheException = new CacheAccessException(exception);
View Full Code Here

        // Ehcaches
        for (String cacheName : ehcacheManager.getCacheNames()) {
            Cache cache = ehcacheManager.getCache(cacheName);
            if (cache != null) {
                // flush
                cache.removeAll(!propagateInCluster);
                // reset statistics
                cache.clearStatistics();
            }
        }
View Full Code Here

        logger.info("Flushing {}", cacheName);
        CacheManager ehcacheManager = getEhcacheManager();
        Cache cache = ehcacheManager.getCache(cacheName);
        if (cache != null) {
            // flush
            cache.removeAll(!propagateInCluster);
            // reset statistics
            cache.clearStatistics();
            logger.info("...done flushing {}", cacheName);
        } else {
            logger.warn("Cache with the name {} not found. Skip flushing.", cacheName);
View Full Code Here

                continue;
            }
            Cache cache = ehcacheManager.getCache(cacheName);
            if (cache != null) {
                // flush
                cache.removeAll(!propagateInCluster);
                // reset statistics
                cache.clearStatistics();
                logger.info("...done flushing {}", cacheName);
            }
        }
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

            CacheException cacheException = null;

            try {
                for (final String cacheName : cacheNames) {
                    final Cache cache = getCache(cacheName);
                    cache.removeAll();
                }
            }
            catch (CacheException exception) {
                cacheException = exception;
            }
View Full Code Here

    public void clear() {
        String[] cacheNames = getCacheManager().getCacheNames();
        if(cacheNames != null) {
            for(int i = 0; i < cacheNames.length; i++) {
                Cache cache = getRegion(cacheNames[i]);
                cache.removeAll();
            }
        }
    }
   
    protected Cache getRegion(String regionName) {
View Full Code Here

   {
      String[] strings = cacheManager.getCacheNames();
      for (String cacheName : strings)
      {
         Cache cache = getCacheRegion(cacheName);
         cache.removeAll();
      }
   }

   @Override
   public Object get(String region, String key)
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.