I know how to create a CacheManager
using an XMLConfiguration
in org.ehcache:ehcache:3.8.1:
import org.ehcache.config.Configuration;
import org.ehcache.xml.XmlConfiguration;
import org.ehcache.config.builders.CacheManagerBuilder;
.
.
.
URL myUrl = CacheUtil.class.getResource("/my-config.xml");
Configuration xmlConfig = new XmlConfiguration(myUrl);
cacheManager = CacheManagerBuilder.newCacheManager(xmlConfig);
cacheManager.init();
I also know how to create a CacheManager
with a StatisticsService
:
StatisticsService statisticsService = new DefaultStatisticsService();
CacheManager cacheManager = CacheManagerBuilder.newCacheManagerBuilder()
.using(statisticsService)
.build();
cacheManager.init();
But how do I create a CacheManager
from an XMLConfiguration
using a StatisticsService
?