Is there a replacement for net.sf.ehcache.CacheManager.ALL_CACHE_MANAGERS
in
<!-- https://mvnrepository.com/artifact/org.ehcache/ehcache -->
<dependency>
<groupId>org.ehcache</groupId>
<artifactId>ehcache</artifactId>
<version>3.8.1</version>
</dependency>
?
This is the code that I need to modify to work with version 3.8.1:
import org.ehcache.CacheManager;
.
.
.
List list = CacheManager.ALL_CACHE_MANAGERS;
for (int i = 0, n = list.size(); i < n; i++) {
CacheManager cm = (CacheManager) list.get(i);
log.debug("CacheManager: " + cm.getName());
if (cm.getName().equals(CACHE_MANAGER_NAME)) {
log.debug("CM " + CACHE_MANAGER_NAME + " existed. Destroying it.");
cm.shutdown();
}
}
Is there a way of doing this in ehcache 3.8.1?