Skip to content

Commit eeac3a0

Browse files
authored
Add empty constructor for DubboLifecycleComponentApplicationListener (#7357)
* add empty constructor for DubboLifecycleComponentApplicationListener * recover format * recover format * add empty constructor for DubboBootstrapApplicationListener
1 parent 283c079 commit eeac3a0

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/context/DubboBootstrapApplicationListener.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ public class DubboBootstrapApplicationListener extends OnceApplicationContextEve
4343

4444
private final DubboBootstrap dubboBootstrap;
4545

46+
public DubboBootstrapApplicationListener() {
47+
this.dubboBootstrap = DubboBootstrap.getInstance();
48+
}
49+
4650
public DubboBootstrapApplicationListener(ApplicationContext applicationContext) {
4751
super(applicationContext);
4852
this.dubboBootstrap = DubboBootstrap.getInstance();
@@ -51,6 +55,9 @@ public DubboBootstrapApplicationListener(ApplicationContext applicationContext)
5155

5256
@Override
5357
public void onApplicationContextEvent(ApplicationContextEvent event) {
58+
if (DubboBootstrapStartStopListenerSpringAdapter.applicationContext == null) {
59+
DubboBootstrapStartStopListenerSpringAdapter.applicationContext = event.getApplicationContext();
60+
}
5461
if (event instanceof ContextRefreshedEvent) {
5562
onContextRefreshedEvent((ContextRefreshedEvent) event);
5663
} else if (event instanceof ContextClosedEvent) {

dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/context/DubboLifecycleComponentApplicationListener.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
*/
1717
package org.apache.dubbo.config.spring.context;
1818

19-
2019
import org.apache.dubbo.common.context.Lifecycle;
2120

2221
import com.alibaba.spring.context.OnceApplicationContextEventListener;
@@ -51,6 +50,9 @@ public class DubboLifecycleComponentApplicationListener extends OnceApplicationC
5150

5251
private List<Lifecycle> lifecycleComponents = emptyList();
5352

53+
public DubboLifecycleComponentApplicationListener() {
54+
}
55+
5456
public DubboLifecycleComponentApplicationListener(ApplicationContext applicationContext) {
5557
super(applicationContext);
5658
}

0 commit comments

Comments
 (0)