|
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. |
|
56 | 56 | import org.springframework.integration.config.ConsumerEndpointFactoryBean; |
57 | 57 | import org.springframework.integration.config.IntegrationConfigUtils; |
58 | 58 | import org.springframework.integration.config.SourcePollingChannelAdapterFactoryBean; |
| 59 | +import org.springframework.integration.context.IntegrationContextUtils; |
59 | 60 | import org.springframework.integration.core.MessageSource; |
60 | 61 | import org.springframework.integration.dsl.ComponentsRegistration; |
61 | 62 | import org.springframework.integration.dsl.ConsumerEndpointSpec; |
@@ -282,7 +283,9 @@ else if (component instanceof AnnotationGatewayProxyFactoryBean) { |
282 | 283 | String beanNameToUse = entry.getValue(); |
283 | 284 | if (StringUtils.hasText(beanNameToUse) && |
284 | 285 | ConfigurableBeanFactory.SCOPE_PROTOTYPE.equals( |
285 | | - this.beanFactory.getBeanDefinition(beanNameToUse).getScope())) { |
| 286 | + IntegrationContextUtils.getBeanDefinition(beanNameToUse, this.beanFactory) |
| 287 | + .getScope())) { |
| 288 | + |
286 | 289 | this.beanFactory.initializeBean(componentToUse, beanNameToUse); |
287 | 290 | } |
288 | 291 | targetIntegrationComponents.put(component, beanNameToUse); |
@@ -392,7 +395,8 @@ private boolean noBeanPresentForComponent(Object instance, String parentBeanName |
392 | 395 | String beanName = ((NamedComponent) instance).getBeanName(); |
393 | 396 | if (beanName != null) { |
394 | 397 | if (this.beanFactory.containsBean(beanName)) { |
395 | | - BeanDefinition existingBeanDefinition = this.beanFactory.getBeanDefinition(beanName); |
| 398 | + BeanDefinition existingBeanDefinition = |
| 399 | + IntegrationContextUtils.getBeanDefinition(beanName, this.beanFactory); |
396 | 400 | if (!ConfigurableBeanFactory.SCOPE_PROTOTYPE.equals(existingBeanDefinition.getScope()) |
397 | 401 | && !instance.equals(this.beanFactory.getBean(beanName))) { |
398 | 402 |
|
|
0 commit comments