|
1 | 1 | /* |
2 | | - * Copyright 2016-2019 the original author or authors. |
| 2 | + * Copyright 2016-2020 the original author or authors. |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | * you may not use this file except in compliance with the License. |
|
57 | 57 | import org.springframework.integration.config.ConsumerEndpointFactoryBean; |
58 | 58 | import org.springframework.integration.config.IntegrationConfigUtils; |
59 | 59 | import org.springframework.integration.config.SourcePollingChannelAdapterFactoryBean; |
| 60 | +import org.springframework.integration.context.IntegrationContextUtils; |
60 | 61 | import org.springframework.integration.core.MessageSource; |
61 | 62 | import org.springframework.integration.dsl.ComponentsRegistration; |
62 | 63 | import org.springframework.integration.dsl.ConsumerEndpointSpec; |
@@ -138,7 +139,8 @@ public void afterSingletonsInstantiated() { |
138 | 139 | } |
139 | 140 | } |
140 | 141 |
|
141 | | - private Object processStandardIntegrationFlow(StandardIntegrationFlow flow, String flowBeanName) { // NOSONAR complexity |
| 142 | + private Object processStandardIntegrationFlow(StandardIntegrationFlow flow, String flowBeanName) { // NOSONAR |
| 143 | + // complexity |
142 | 144 | String flowNamePrefix = flowBeanName + "."; |
143 | 145 | if (this.flowContext == null) { |
144 | 146 | this.flowContext = this.beanFactory.getBean(IntegrationFlowContext.class); |
@@ -283,7 +285,9 @@ else if (component instanceof AnnotationGatewayProxyFactoryBean) { |
283 | 285 | String beanNameToUse = entry.getValue(); |
284 | 286 | if (StringUtils.hasText(beanNameToUse) && |
285 | 287 | ConfigurableBeanFactory.SCOPE_PROTOTYPE.equals( |
286 | | - this.beanFactory.getBeanDefinition(beanNameToUse).getScope())) { |
| 288 | + IntegrationContextUtils.getBeanDefinition(beanNameToUse, this.beanFactory) |
| 289 | + .getScope())) { |
| 290 | + |
287 | 291 | this.beanFactory.initializeBean(componentToUse, beanNameToUse); |
288 | 292 | } |
289 | 293 | targetIntegrationComponents.put(component, beanNameToUse); |
@@ -393,7 +397,8 @@ private boolean noBeanPresentForComponent(Object instance, String parentBeanName |
393 | 397 | String beanName = ((NamedComponent) instance).getBeanName(); |
394 | 398 | if (beanName != null) { |
395 | 399 | if (this.beanFactory.containsBean(beanName)) { |
396 | | - BeanDefinition existingBeanDefinition = this.beanFactory.getBeanDefinition(beanName); |
| 400 | + BeanDefinition existingBeanDefinition = |
| 401 | + IntegrationContextUtils.getBeanDefinition(beanName, this.beanFactory); |
397 | 402 | if (!ConfigurableBeanFactory.SCOPE_PROTOTYPE.equals(existingBeanDefinition.getScope()) |
398 | 403 | && !instance.equals(this.beanFactory.getBean(beanName))) { |
399 | 404 |
|
@@ -429,8 +434,8 @@ private void registerComponent(Object component, String beanName, String parentN |
429 | 434 |
|
430 | 435 | AbstractBeanDefinition beanDefinition = |
431 | 436 | BeanDefinitionBuilder.genericBeanDefinition((Class<Object>) component.getClass(), () -> component) |
432 | | - .applyCustomizers(customizers) |
433 | | - .getRawBeanDefinition(); |
| 437 | + .applyCustomizers(customizers) |
| 438 | + .getRawBeanDefinition(); |
434 | 439 |
|
435 | 440 | if (parentName != null && this.beanFactory.containsBeanDefinition(parentName)) { |
436 | 441 | AbstractBeanDefinition parentBeanDefinition = |
|
0 commit comments