Examples of evictExpiredElements()


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

    public void run() {
      while(run) {
        Cache cache = CacheManager.getInstance().getCache(cacheName);
        if(cache != null) {
          cache.evictExpiredElements();
        }
        try {
          Thread.sleep(1000*seconds);
        } catch(Exception e) {
        }
View Full Code Here

Examples of net.sf.ehcache.Ehcache.evictExpiredElements()

        for (final String cacheName : cacheNames) {
            final Ehcache cache = this.cacheManager.getEhcache(cacheName);
           
            final long preEvictSize = cache.getMemoryStoreSize();
            final long startEviction = System.currentTimeMillis();
            cache.evictExpiredElements();
           
            if (this.logger.isDebugEnabled()) {
                final long evicted = preEvictSize - cache.getMemoryStoreSize();
                evictions += evicted;
                this.logger.debug("Evicted " + evicted + " expired elements from cache '" + cacheName + "' in " + (System.currentTimeMillis() - startEviction) + "ms");
View Full Code Here

Examples of net.sf.ehcache.Ehcache.evictExpiredElements()

            for (String cacheName : cacheNames) {
                final Ehcache cache = this.cacheManager.getEhcache(cacheName);
                if (null != cache) {
                    final long preEvictSize = cache.getMemoryStoreSize();
                    final long evictStart = System.nanoTime();
                    cache.evictExpiredElements();
                    if (logger.isDebugEnabled()) {
                        final long evicted = preEvictSize - cache.getMemoryStoreSize();
                        evictedTotal += evicted;
                        logger.debug("Evicted " + evicted + " elements from cache '" + cacheName + "' in "
                                + TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - evictStart) + " ms");
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.