Commit 74f29998 by 赵天增

补充注释

parent 554b9508
......@@ -18,6 +18,7 @@ package de.codecentric.boot.admin.client.registration;
import java.time.Duration;
import java.util.concurrent.ScheduledFuture;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.DisposableBean;
......@@ -32,6 +33,8 @@ import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
/**
* Listener responsible for starting and stopping the registration task when the application is
* ready.
* <p>
* 监听器负责在应用程序准备就绪时启动和停止注册任务
*
* @author Johannes Edmeier
*/
......@@ -82,6 +85,9 @@ public class RegistrationApplicationListener implements InitializingBean, Dispos
}
}
/**
* 开始定时执行注册的任务,每十秒去刷新一次
*/
public void startRegisterTask() {
if (scheduledTask != null && !scheduledTask.isDone()) {
return;
......
......@@ -40,10 +40,11 @@ public class InstanceRegistry {
}
/**
* 注册实例
* Register instance.
*
* @param registration instance to be registered.
* @return the if of the registered instance.
* @param registration 实例将会被注册.
* @return 注册之后的ID.
*/
public Mono<InstanceId> register(Registration registration) {
Assert.notNull(registration, "'registration' must not be null");
......
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