Commit 28d2955d authored by Stephane Nicoll's avatar Stephane Nicoll

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