Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.0] set module started at applicationDeployer checkStarted() #9013

Merged
merged 1 commit into from
Oct 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@ public interface ApplicationDeployer extends Deployer<ApplicationModel> {

void checkStarting();

void checkStarted();
void checkStarted(CompletableFuture checkerStartFuture);

}
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,7 @@ public void checkStarting() {
}

@Override
public void checkStarted() {
public void checkStarted(CompletableFuture checkerStartFuture) {
for (ModuleModel moduleModel : applicationModel.getModuleModels()) {
if (moduleModel.getDeployer().isPending()) {
setPending();
Expand All @@ -839,7 +839,7 @@ public void checkStarted() {
}
}
// all modules has been started
onStarted();
onStarted(checkerStartFuture);
}

private void onStarting() {
Expand All @@ -849,14 +849,17 @@ private void onStarting() {
}
}

private void onStarted() {
private void onStarted(CompletableFuture checkerStartFuture) {
setStarted();
if (logger.isInfoEnabled()) {
logger.info(getIdentifier() + " is ready.");
}
if (startFuture != null) {
startFuture.complete(true);
}
if (checkerStartFuture != null) {
checkerStartFuture.complete(true);
}
}

private void onStopping() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,7 @@ private void onModuleStarting() {
private void onModuleStarted(CompletableFuture startFuture) {
setStarted();
logger.info(getIdentifier() + " has started.");
startFuture.complete(true);
applicationDeployer.checkStarted();
applicationDeployer.checkStarted(startFuture);
}

private void onModuleStopping() {
Expand Down