if (this.logger.isDebugEnabled()) {
this.logger.debug("Found " + cacheNames.length + " caches to clean.");
}
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");
}
}