You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by il...@apache.org on 2018/10/30 09:12:45 UTC

[incubator-dubbo] branch master updated: 重构 ServiceBean 的 isDelay 方法,使其更符合语义 (#2686)

This is an automated email from the ASF dual-hosted git repository.

iluo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-dubbo.git


The following commit(s) were added to refs/heads/master by this push:
     new 4d0a36c  重构 ServiceBean 的 isDelay 方法,使其更符合语义 (#2686)
4d0a36c is described below

commit 4d0a36c435ca59bfcf909c0e76fa2ab024fb7408
Author: 田小波 <ti...@outlook.com>
AuthorDate: Tue Oct 30 17:12:38 2018 +0800

    重构 ServiceBean 的 isDelay 方法,使其更符合语义 (#2686)
    
    * Refactor method isDelay of ServiceBean to fix the wrong meaning of the method
    
    * Remove unnecessary method isDelay of ServiceBean
---
 .../java/org/apache/dubbo/config/spring/ServiceBean.java    | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

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 1d5ff8e..6d7bc9b 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
@@ -107,7 +107,7 @@ public class ServiceBean<T> extends ServiceConfig<T> implements InitializingBean
 
     @Override
     public void onApplicationEvent(ContextRefreshedEvent event) {
-        if (isDelay() && !isExported() && !isUnexported()) {
+        if (!isExported() && !isUnexported()) {
             if (logger.isInfoEnabled()) {
                 logger.info("The service ready on spring started. service: " + getInterface());
             }
@@ -115,15 +115,6 @@ public class ServiceBean<T> extends ServiceConfig<T> implements InitializingBean
         }
     }
 
-    private boolean isDelay() {
-        Integer delay = getDelay();
-        ProviderConfig provider = getProvider();
-        if (delay == null && provider != null) {
-            delay = provider.getDelay();
-        }
-        return supportedApplicationListener && (delay == null || delay == -1);
-    }
-
     @Override
     @SuppressWarnings({"unchecked", "deprecation"})
     public void afterPropertiesSet() throws Exception {
@@ -251,7 +242,7 @@ public class ServiceBean<T> extends ServiceConfig<T> implements InitializingBean
                 setPath(beanName);
             }
         }
-        if (!isDelay()) {
+        if (!supportedApplicationListener) {
             export();
         }
     }