Is there a way to abstract the EhCache 3 CacheManager (org.ehcache.CacheManager
) to Spring's CacheManager (org.springframework.cache.CacheManager
)?
With EhCache2, it is possible, by the following:
@Bean
public org.springframework.cache.CacheManager cacheManager(net.sf.ehcache.CacheManager ehcache) {
EhCacheCacheManager cacheManager = new EhCacheCacheManager(ehcache);
return cacheManager;
}
HINT: I've found a way to abstract the javax.cache.CacheManager
cacheManager to the Spring's CacheManager (org.springframework.cache.CacheManager
), by:
@Bean
public org.springframework.cache.CacheManager cacheManager(javax.cache.CacheManager cacheManager) {
return new JCacheCacheManager(cacheManager);
}
It will be also helpful if there is a way to cast org.ehcache.CacheManager
to javax.cache.CacheManager
.
Thanks.