Commit 091478e0 authored by Stephane Nicoll's avatar Stephane Nicoll

Disable ehcache statistics if necessary

`EhCacheStatisticsProvider` uses the `StatisticsGateway` API introduced
in ehcache 2.7 (march 2013). If an older ehcache version is present, we
should back-off as this class is not available.

Closes gh-4621
parent d6a424f9
...@@ -21,6 +21,7 @@ import javax.cache.Caching; ...@@ -21,6 +21,7 @@ import javax.cache.Caching;
import com.hazelcast.core.IMap; import com.hazelcast.core.IMap;
import com.hazelcast.spring.cache.HazelcastCache; import com.hazelcast.spring.cache.HazelcastCache;
import net.sf.ehcache.Ehcache; import net.sf.ehcache.Ehcache;
import net.sf.ehcache.statistics.StatisticsGateway;
import org.infinispan.spring.provider.SpringCache; import org.infinispan.spring.provider.SpringCache;
import org.springframework.boot.actuate.cache.CacheStatistics; import org.springframework.boot.actuate.cache.CacheStatistics;
...@@ -72,7 +73,7 @@ public class CacheStatisticsAutoConfiguration { ...@@ -72,7 +73,7 @@ public class CacheStatisticsAutoConfiguration {
} }
@Configuration @Configuration
@ConditionalOnClass({ EhCacheCache.class, Ehcache.class }) @ConditionalOnClass({ EhCacheCache.class, Ehcache.class, StatisticsGateway.class })
static class EhCacheCacheStatisticsProviderConfiguration { static class EhCacheCacheStatisticsProviderConfiguration {
@Bean @Bean
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment