Fix Hazelcast cache statistics condition

Make sure the Hazelcast statistics support is not triggered if the Spring
support is not present. The Hazelcast dependency alone may be used with
JCache and this should not trigger the support of the native Hazelcast
metrics infra.

See gh-2633
This commit is contained in:
Stephane Nicoll
2015-06-01 15:08:59 +02:00
parent fc0eed97cf
commit 28d2955d03

View File

@@ -18,6 +18,8 @@ package org.springframework.boot.actuate.autoconfigure;
import javax.cache.Caching;
import com.hazelcast.core.IMap;
import com.hazelcast.spring.cache.HazelcastCache;
import net.sf.ehcache.Ehcache;
import org.springframework.boot.actuate.cache.CacheStatistics;
@@ -41,8 +43,6 @@ import org.springframework.cache.support.NoOpCacheManager;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import com.hazelcast.core.IMap;
/**
* {@link EnableAutoConfiguration Auto-configuration} for {@link CacheStatisticsProvider}
* beans.
@@ -79,7 +79,7 @@ public class CacheStatisticsAutoConfiguration {
}
@Configuration
@ConditionalOnClass(IMap.class)
@ConditionalOnClass({ IMap.class, HazelcastCache.class} )
static class HazelcastCacheStatisticsConfiguration {
@Bean