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

Application-granular service registration and discovery are compatible with api calling methods #7369

Merged
merged 3 commits into from
May 31, 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 @@ -206,6 +206,7 @@ public synchronized T get() {
return ref;
}

@Override
public synchronized void destroy() {
if (ref == null) {
return;
Expand Down Expand Up @@ -234,6 +235,10 @@ public synchronized void init() {

if (bootstrap == null) {
bootstrap = DubboBootstrap.getInstance();
// compatible with api call.
if (null != this.getRegistries()) {
bootstrap.registries(this.getRegistries());
}
bootstrap.initialize();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,15 +149,18 @@ public ServiceConfig(Service service) {
}

@Parameter(excluded = true)
@Override
public boolean isExported() {
return exported;
}

@Parameter(excluded = true)
@Override
public boolean isUnexported() {
return unexported;
}

@Override
public void unexport() {
if (!exported) {
return;
Expand All @@ -181,9 +184,14 @@ public void unexport() {
dispatch(new ServiceConfigUnexportedEvent(this));
}

@Override
public synchronized void export() {
if (bootstrap == null) {
bootstrap = DubboBootstrap.getInstance();
// compatible with api call.
if (null != this.getRegistry()) {
bootstrap.registries(this.getRegistries());
}
bootstrap.initialize();
}

Expand Down