You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by al...@apache.org on 2021/03/28 08:21:13 UTC
[dubbo] branch master updated: Add empty constructor for
DubboLifecycleComponentApplicationListener (#7357)
This is an automated email from the ASF dual-hosted git repository.
albumenj pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo.git
The following commit(s) were added to refs/heads/master by this push:
new eeac3a0 Add empty constructor for DubboLifecycleComponentApplicationListener (#7357)
eeac3a0 is described below
commit eeac3a08e1ae19596d0cf5ea72a009cb022dc27b
Author: Albumen Kevin <jh...@gmail.com>
AuthorDate: Sun Mar 28 16:20:32 2021 +0800
Add empty constructor for DubboLifecycleComponentApplicationListener (#7357)
* add empty constructor for DubboLifecycleComponentApplicationListener
* recover format
* recover format
* add empty constructor for DubboBootstrapApplicationListener
---
.../config/spring/context/DubboBootstrapApplicationListener.java | 7 +++++++
.../spring/context/DubboLifecycleComponentApplicationListener.java | 4 +++-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/context/DubboBootstrapApplicationListener.java b/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/context/DubboBootstrapApplicationListener.java
index 58d8f40..2c5829d 100644
--- a/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/context/DubboBootstrapApplicationListener.java
+++ b/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/context/DubboBootstrapApplicationListener.java
@@ -43,6 +43,10 @@ public class DubboBootstrapApplicationListener extends OnceApplicationContextEve
private final DubboBootstrap dubboBootstrap;
+ public DubboBootstrapApplicationListener() {
+ this.dubboBootstrap = DubboBootstrap.getInstance();
+ }
+
public DubboBootstrapApplicationListener(ApplicationContext applicationContext) {
super(applicationContext);
this.dubboBootstrap = DubboBootstrap.getInstance();
@@ -51,6 +55,9 @@ public class DubboBootstrapApplicationListener extends OnceApplicationContextEve
@Override
public void onApplicationContextEvent(ApplicationContextEvent event) {
+ if (DubboBootstrapStartStopListenerSpringAdapter.applicationContext == null) {
+ DubboBootstrapStartStopListenerSpringAdapter.applicationContext = event.getApplicationContext();
+ }
if (event instanceof ContextRefreshedEvent) {
onContextRefreshedEvent((ContextRefreshedEvent) event);
} else if (event instanceof ContextClosedEvent) {
diff --git a/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/context/DubboLifecycleComponentApplicationListener.java b/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/context/DubboLifecycleComponentApplicationListener.java
index 3533804..020ce8b 100644
--- a/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/context/DubboLifecycleComponentApplicationListener.java
+++ b/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/context/DubboLifecycleComponentApplicationListener.java
@@ -16,7 +16,6 @@
*/
package org.apache.dubbo.config.spring.context;
-
import org.apache.dubbo.common.context.Lifecycle;
import com.alibaba.spring.context.OnceApplicationContextEventListener;
@@ -51,6 +50,9 @@ public class DubboLifecycleComponentApplicationListener extends OnceApplicationC
private List<Lifecycle> lifecycleComponents = emptyList();
+ public DubboLifecycleComponentApplicationListener() {
+ }
+
public DubboLifecycleComponentApplicationListener(ApplicationContext applicationContext) {
super(applicationContext);
}