From d64cfa5cad9935f922392163ef667b9e273c59a0 Mon Sep 17 00:00:00 2001 From: Spencer Gibb Date: Thu, 13 Aug 2015 16:40:50 -0600 Subject: [PATCH] polish --- .../cloud/netflix/eureka/CloudEurekaClient.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/eureka/CloudEurekaClient.java b/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/eureka/CloudEurekaClient.java index daa4a489..4338c1f9 100644 --- a/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/eureka/CloudEurekaClient.java +++ b/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/eureka/CloudEurekaClient.java @@ -28,6 +28,8 @@ import com.netflix.discovery.DiscoveryClient; import com.netflix.discovery.EurekaClientConfig; /** + * Subclass of {@link DiscoveryClient} that sends a {@link HeartbeatEvent} when + * {@link CloudEurekaClient#onCacheRefreshed()} is called. * @author Spencer Gibb */ @CommonsLog @@ -52,7 +54,7 @@ public class CloudEurekaClient extends DiscoveryClient { @Override protected void onCacheRefreshed() { - if (this.cacheRefreshedCount != null) { //might be call during construction and won't be inited yet + if (this.cacheRefreshedCount != null) { //might be called during construction and will be null long newCount = this.cacheRefreshedCount.incrementAndGet(); log.trace("onCacheRefreshed called with count: " + newCount); this.context.publishEvent(new HeartbeatEvent(this, newCount));