Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.0] Remove DubboLifecycleComponent #8232

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import org.apache.dubbo.config.spring.beans.factory.config.DubboConfigDefaultPropertyValueBeanPostProcessor;
import org.apache.dubbo.config.spring.context.DubboBootstrapApplicationListener;
import org.apache.dubbo.config.spring.context.DubboInfraBeanRegisterPostProcessor;
import org.apache.dubbo.config.spring.context.DubboLifecycleComponentApplicationListener;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
Expand Down Expand Up @@ -54,7 +53,6 @@ public interface DubboBeanUtils {
* @see ReferenceAnnotationBeanPostProcessor
* @see DubboConfigDefaultPropertyValueBeanPostProcessor
* @see DubboConfigAliasPostProcessor
* @see DubboLifecycleComponentApplicationListener
* @see DubboBootstrapApplicationListener
*/
static void registerCommonBeans(BeanDefinitionRegistry registry) {
Expand All @@ -72,10 +70,6 @@ static void registerCommonBeans(BeanDefinitionRegistry registry) {
registerInfrastructureBean(registry, DubboConfigAliasPostProcessor.BEAN_NAME,
DubboConfigAliasPostProcessor.class);

// Since 2.7.5 Register DubboLifecycleComponentApplicationListener as an infrastructure Bean
// registerInfrastructureBean(registry, DubboLifecycleComponentApplicationListener.BEAN_NAME,
// DubboLifecycleComponentApplicationListener.class);

// Since 2.7.4 Register DubboBootstrapApplicationListener as an infrastructure Bean
registerInfrastructureBean(registry, DubboBootstrapApplicationListener.BEAN_NAME,
DubboBootstrapApplicationListener.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor;
import org.apache.dubbo.config.spring.beans.factory.annotation.ServiceAnnotationPostProcessor;
import org.apache.dubbo.config.spring.context.DubboBootstrapApplicationListener;
import org.apache.dubbo.config.spring.context.DubboLifecycleComponentApplicationListener;
import org.apache.dubbo.config.spring.context.annotation.EnableDubboConfig;

import org.springframework.beans.BeansException;
Expand Down Expand Up @@ -80,11 +79,8 @@ public ServiceAnnotationPostProcessor serviceAnnotationBeanProcessor(@Qualifier(
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
if (applicationContext instanceof ConfigurableApplicationContext) {
ConfigurableApplicationContext context = (ConfigurableApplicationContext) applicationContext;
// DubboLifecycleComponentApplicationListener dubboLifecycleComponentApplicationListener
// = new DubboLifecycleComponentApplicationListener();
// dubboLifecycleComponentApplicationListener.setApplicationContext(applicationContext);
// context.addApplicationListener(dubboLifecycleComponentApplicationListener);

// Why register ApplicationListener here?
DubboBootstrapApplicationListener dubboBootstrapApplicationListener = new DubboBootstrapApplicationListener();
dubboBootstrapApplicationListener.setApplicationContext(applicationContext);
context.addApplicationListener(dubboBootstrapApplicationListener);
Expand All @@ -95,7 +91,6 @@ public void setApplicationContext(ApplicationContext applicationContext) throws
public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) throws BeansException {
// Remove the BeanDefinitions of ApplicationListener from DubboBeanUtils#registerCommonBeans(BeanDefinitionRegistry)
// TODO Refactoring in Dubbo 2.7.9
removeBeanDefinition(registry, DubboLifecycleComponentApplicationListener.BEAN_NAME);
removeBeanDefinition(registry, DubboBootstrapApplicationListener.BEAN_NAME);
}

Expand Down