Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
spring-boot-admin
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openSource
spring-boot-admin
Commits
74f29998
Commit
74f29998
authored
Jul 25, 2018
by
赵天增
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
补充注释
parent
554b9508
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
3 deletions
+10
-3
RegistrationApplicationListener.java
.../client/registration/RegistrationApplicationListener.java
+6
-0
InstanceRegistry.java
...ecentric/boot/admin/server/services/InstanceRegistry.java
+4
-3
No files found.
spring-boot-admin-client/src/main/java/de/codecentric/boot/admin/client/registration/RegistrationApplicationListener.java
View file @
74f29998
...
...
@@ -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
;
...
...
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/services/InstanceRegistry.java
View file @
74f29998
...
...
@@ -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"
);
...
...
@@ -94,6 +95,6 @@ public class InstanceRegistry {
*/
public
Mono
<
InstanceId
>
deregister
(
InstanceId
id
)
{
return
repository
.
computeIfPresent
(
id
,
(
key
,
instance
)
->
Mono
.
just
(
instance
.
deregister
()))
.
map
(
Instance:
:
getId
);
.
map
(
Instance:
:
getId
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment