@SuppressWarnings("deprecation") private void registerComponent(Object component, String beanName, String parentName, boolean registerSingleton) { if (component instanceof org.springframework.integration.expression.IntegrationEvaluationContextAware) { EvaluationContext evaluationContext = IntegrationContextUtils.getEvaluationContext(this.beanFactory); ((org.springframework.integration.expression.IntegrationEvaluationContextAware) component) .setIntegrationEvaluationContext(evaluationContext); } if (component instanceof ApplicationListener) { this.applicationListeners.add((ApplicationListener<?>) component); } this.autowiredAnnotationBeanPostProcessor.processInjection(component); this.beanFactory.initializeBean(component, beanName); if (registerSingleton) { this.beanFactory.registerSingleton(beanName, component); if (parentName != null) { this.beanFactory.registerDependentBean(parentName, beanName); } } if (component instanceof DisposableBean) { ((DefaultSingletonBeanRegistry) this.beanFactory) .registerDisposableBean(beanName, (DisposableBean) component); } }
@SuppressWarnings("deprecation") private void registerComponent(Object component, String beanName, String parentName, boolean registerSingleton) { if (component instanceof org.springframework.integration.expression.IntegrationEvaluationContextAware) { EvaluationContext evaluationContext = IntegrationContextUtils.getEvaluationContext(this.beanFactory); ((org.springframework.integration.expression.IntegrationEvaluationContextAware) component) .setIntegrationEvaluationContext(evaluationContext); } if (component instanceof ApplicationListener) { this.applicationListeners.add((ApplicationListener<?>) component); } this.autowiredAnnotationBeanPostProcessor.processInjection(component); this.beanFactory.initializeBean(component, beanName); if (registerSingleton) { this.beanFactory.registerSingleton(beanName, component); if (parentName != null) { this.beanFactory.registerDependentBean(parentName, beanName); } } if (component instanceof DisposableBean) { ((DefaultSingletonBeanRegistry) this.beanFactory) .registerDisposableBean(beanName, (DisposableBean) component); } }