This is an automated email from the ASF dual-hosted git repository.
albumenj pushed a commit to branch 3.0
in repository https://gitbox.apache.org/repos/asf/dubbo.git
The following commit(s) were added to refs/heads/3.0 by this push:
new 0495567 Improve service exported logic (#8160)
0495567 is described below
commit 0495567b00ef1349f452928e6fdf926e429c1432
Author: Gong Dewei <[email protected]>
AuthorDate: Mon Jun 28 19:01:20 2021 +0800
Improve service exported logic (#8160)
---
.../src/main/java/org/apache/dubbo/config/ServiceConfig.java | 4 ++--
.../src/main/java/org/apache/dubbo/config/spring/ServiceBean.java | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git
a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ServiceConfig.java
b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ServiceConfig.java
index 9058e7d..f681e27 100644
---
a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ServiceConfig.java
+++
b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ServiceConfig.java
@@ -237,7 +237,8 @@ public class ServiceConfig<T> extends ServiceConfigBase<T> {
}
}
- public void exported() {
+ protected void exported() {
+ exported = true;
List<URL> exportedURLs = this.getExportedUrls();
exportedURLs.forEach(url -> {
ServiceNameMapping serviceNameMapping =
ServiceNameMapping.getDefaultExtension();
@@ -330,7 +331,6 @@ public class ServiceConfig<T> extends ServiceConfigBase<T> {
if (exported) {
return;
}
- exported = true;
if (StringUtils.isEmpty(path)) {
path = interfaceName;
diff --git
a/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/ServiceBean.java
b/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/ServiceBean.java
index b596568..ca3e85c 100644
---
a/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/ServiceBean.java
+++
b/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/ServiceBean.java
@@ -109,7 +109,7 @@ public class ServiceBean<T> extends ServiceConfig<T>
implements InitializingBean
* @since 2.6.5
*/
@Override
- public void exported() {
+ protected void exported() {
super.exported();
// Publish ServiceBeanExportedEvent
publishExportEvent();