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
This commit is contained in:
Stephane Nicoll 2015-11-26 16:15:29 +01:00
parent d6a424f94c
commit 091478e0fd

View File

@ -21,6 +21,7 @@ import javax.cache.Caching;
import com.hazelcast.core.IMap;
import com.hazelcast.spring.cache.HazelcastCache;
import net.sf.ehcache.Ehcache;
import net.sf.ehcache.statistics.StatisticsGateway;
import org.infinispan.spring.provider.SpringCache;
import org.springframework.boot.actuate.cache.CacheStatistics;
@ -72,7 +73,7 @@ public class CacheStatisticsAutoConfiguration {
}
@Configuration
@ConditionalOnClass({ EhCacheCache.class, Ehcache.class })
@ConditionalOnClass({ EhCacheCache.class, Ehcache.class, StatisticsGateway.class })
static class EhCacheCacheStatisticsProviderConfiguration {
@Bean