From 01cef053efb5814735742a2c9ce5775168d36889 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=94=B0=E5=B0=8F=E6=B3=A2?= Date: Tue, 30 Oct 2018 17:12:38 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=9E=84=20ServiceBean=20=E7=9A=84=20?= =?UTF-8?q?isDelay=20=E6=96=B9=E6=B3=95=EF=BC=8C=E4=BD=BF=E5=85=B6?= =?UTF-8?q?=E6=9B=B4=E7=AC=A6=E5=90=88=E8=AF=AD=E4=B9=89=20(#2686)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Refactor method isDelay of ServiceBean to fix the wrong meaning of the method * Remove unnecessary method isDelay of ServiceBean --- .../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 1d5ff8e8d309..6d7bc9b64761 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 Service getService() { @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 void onApplicationEvent(ContextRefreshedEvent event) { } } - 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 @@ && getInterface() != null && getInterface().length() > 0 setPath(beanName); } } - if (!isDelay()) { + if (!supportedApplicationListener) { export(); } }