Package net.sf.ehcache

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


            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.