Reduce instance supplier use to appease AOT

* Remove the use of instance suppliers on bean definitions
that are processed during the AOT phase.

* The remaining areas that use instance suppliers do so
at runtime and do not use reflection, but instead
are passed the configured bean to register.

See https://github.com/spring-cloud/spring-cloud-stream/issues/2655

**Cherry-pick to `6.0.x`**
This commit is contained in:
Chris Bono
2023-03-02 18:00:25 -06:00
committed by abilan
parent d9f3821b9b
commit 5c96c0ded0
17 changed files with 82 additions and 110 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -70,6 +70,7 @@ import org.springframework.util.ClassUtils;
* @author Gary Russell
* @author Michael Wiles
* @author Pierre Lakreb
* @author Chris Bono
*
* @see IntegrationContextUtils
*/
@@ -153,14 +154,14 @@ public class DefaultConfiguringBeanFactoryPostProcessor
private void registerBeanFactoryChannelResolver() {
if (!this.beanFactory.containsBeanDefinition(ChannelResolverUtils.CHANNEL_RESOLVER_BEAN_NAME)) {
this.registry.registerBeanDefinition(ChannelResolverUtils.CHANNEL_RESOLVER_BEAN_NAME,
new RootBeanDefinition(BeanFactoryChannelResolver.class, BeanFactoryChannelResolver::new));
new RootBeanDefinition(BeanFactoryChannelResolver.class));
}
}
private void registerMessagePublishingErrorHandler() {
if (!this.beanFactory.containsBeanDefinition(ChannelUtils.MESSAGE_PUBLISHING_ERROR_HANDLER_BEAN_NAME)) {
this.registry.registerBeanDefinition(ChannelUtils.MESSAGE_PUBLISHING_ERROR_HANDLER_BEAN_NAME,
new RootBeanDefinition(MessagePublishingErrorHandler.class, MessagePublishingErrorHandler::new));
new RootBeanDefinition(MessagePublishingErrorHandler.class));
}
}
@@ -173,8 +174,7 @@ public class DefaultConfiguringBeanFactoryPostProcessor
BeanDefinition nullChannelDefinition = null;
BeanFactory beanFactoryToUse = this.beanFactory;
do {
if (beanFactoryToUse instanceof ConfigurableListableBeanFactory) {
ConfigurableListableBeanFactory listable = (ConfigurableListableBeanFactory) beanFactoryToUse;
if (beanFactoryToUse instanceof ConfigurableListableBeanFactory listable) {
if (listable.containsBeanDefinition(IntegrationContextUtils.NULL_CHANNEL_BEAN_NAME)) {
nullChannelDefinition =
listable.getBeanDefinition(IntegrationContextUtils.NULL_CHANNEL_BEAN_NAME);
@@ -193,7 +193,7 @@ public class DefaultConfiguringBeanFactoryPostProcessor
}
else {
this.registry.registerBeanDefinition(IntegrationContextUtils.NULL_CHANNEL_BEAN_NAME,
new RootBeanDefinition(NullChannel.class, NullChannel::new));
new RootBeanDefinition(NullChannel.class));
}
}
@@ -208,9 +208,8 @@ public class DefaultConfiguringBeanFactoryPostProcessor
LOGGER.info(() -> "No bean named '" + IntegrationContextUtils.ERROR_CHANNEL_BEAN_NAME +
"' has been explicitly defined. " +
"Therefore, a default PublishSubscribeChannel will be created.");
this.registry.registerBeanDefinition(IntegrationContextUtils.ERROR_CHANNEL_BEAN_NAME,
BeanDefinitionBuilder.rootBeanDefinition(PublishSubscribeChannel.class, this::createErrorChannel)
BeanDefinitionBuilder.rootBeanDefinition(PublishSubscribeChannel.class)
.addConstructorArgValue(IntegrationProperties.getExpressionFor(
IntegrationProperties.ERROR_CHANNEL_REQUIRE_SUBSCRIBERS))
.addPropertyValue("ignoreFailures", IntegrationProperties.getExpressionFor(
@@ -220,15 +219,13 @@ public class DefaultConfiguringBeanFactoryPostProcessor
String errorLoggerBeanName =
IntegrationContextUtils.ERROR_LOGGER_BEAN_NAME + IntegrationConfigUtils.HANDLER_ALIAS_SUFFIX;
this.registry.registerBeanDefinition(errorLoggerBeanName,
BeanDefinitionBuilder.genericBeanDefinition(LoggingHandler.class,
() -> new LoggingHandler(LoggingHandler.Level.ERROR))
BeanDefinitionBuilder.genericBeanDefinition(LoggingHandler.class)
.addConstructorArgValue(LoggingHandler.Level.ERROR)
.addPropertyValue(IntegrationNamespaceUtils.ORDER, Ordered.LOWEST_PRECEDENCE - 100)
.getBeanDefinition());
BeanDefinitionBuilder loggingEndpointBuilder =
BeanDefinitionBuilder.genericBeanDefinition(ConsumerEndpointFactoryBean.class,
ConsumerEndpointFactoryBean::new)
BeanDefinitionBuilder.genericBeanDefinition(ConsumerEndpointFactoryBean.class)
.addPropertyValue("inputChannelName", IntegrationContextUtils.ERROR_CHANNEL_BEAN_NAME)
.addPropertyReference("handler", errorLoggerBeanName);
@@ -239,11 +236,6 @@ public class DefaultConfiguringBeanFactoryPostProcessor
}
}
private PublishSubscribeChannel createErrorChannel() {
IntegrationProperties integrationProperties = IntegrationContextUtils.getIntegrationProperties(this.beanFactory);
return new PublishSubscribeChannel(integrationProperties.isErrorChannelRequireSubscribers());
}
/**
* Register {@link IntegrationEvaluationContextFactoryBean}
* and {@link IntegrationSimpleEvaluationContextFactoryBean} beans, if necessary.
@@ -251,8 +243,7 @@ public class DefaultConfiguringBeanFactoryPostProcessor
private void registerIntegrationEvaluationContext() {
if (!this.registry.containsBeanDefinition(IntegrationContextUtils.INTEGRATION_EVALUATION_CONTEXT_BEAN_NAME)) {
BeanDefinitionBuilder integrationEvaluationContextBuilder =
BeanDefinitionBuilder.genericBeanDefinition(IntegrationEvaluationContextFactoryBean.class,
IntegrationEvaluationContextFactoryBean::new)
BeanDefinitionBuilder.genericBeanDefinition(IntegrationEvaluationContextFactoryBean.class)
.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
this.registry.registerBeanDefinition(IntegrationContextUtils.INTEGRATION_EVALUATION_CONTEXT_BEAN_NAME,
@@ -263,8 +254,7 @@ public class DefaultConfiguringBeanFactoryPostProcessor
IntegrationContextUtils.INTEGRATION_SIMPLE_EVALUATION_CONTEXT_BEAN_NAME)) {
BeanDefinitionBuilder integrationEvaluationContextBuilder =
BeanDefinitionBuilder.genericBeanDefinition(IntegrationSimpleEvaluationContextFactoryBean.class,
IntegrationSimpleEvaluationContextFactoryBean::new)
BeanDefinitionBuilder.genericBeanDefinition(IntegrationSimpleEvaluationContextFactoryBean.class)
.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
this.registry.registerBeanDefinition(IntegrationContextUtils.INTEGRATION_SIMPLE_EVALUATION_CONTEXT_BEAN_NAME,
@@ -286,7 +276,7 @@ public class DefaultConfiguringBeanFactoryPostProcessor
return;
}
}
RootBeanDefinition beanDefinition = new RootBeanDefinition(clazz, IdGeneratorConfigurer::new);
RootBeanDefinition beanDefinition = new RootBeanDefinition(clazz);
beanDefinition.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
BeanDefinitionReaderUtils.registerWithGeneratedName(beanDefinition, this.registry);
}
@@ -300,8 +290,7 @@ public class DefaultConfiguringBeanFactoryPostProcessor
"' has been explicitly defined. " +
"Therefore, a default ThreadPoolTaskScheduler will be created.");
BeanDefinition scheduler =
BeanDefinitionBuilder.genericBeanDefinition(ThreadPoolTaskScheduler.class,
ThreadPoolTaskScheduler::new)
BeanDefinitionBuilder.genericBeanDefinition(ThreadPoolTaskScheduler.class)
.addPropertyValue("poolSize", IntegrationProperties.getExpressionFor(
IntegrationProperties.TASK_SCHEDULER_POOL_SIZE))
.addPropertyValue("threadNamePrefix", "task-scheduler-")
@@ -319,7 +308,7 @@ public class DefaultConfiguringBeanFactoryPostProcessor
private void registerIntegrationProperties() {
if (!this.beanFactory.containsBean(IntegrationContextUtils.INTEGRATION_GLOBAL_PROPERTIES_BEAN_NAME)) {
BeanDefinition userProperties =
BeanDefinitionBuilder.genericBeanDefinition(PropertiesFactoryBean.class, PropertiesFactoryBean::new)
BeanDefinitionBuilder.genericBeanDefinition(PropertiesFactoryBean.class)
.addPropertyValue("locations", "classpath*:META-INF/spring.integration.properties")
.getBeanDefinition();
@@ -374,7 +363,7 @@ public class DefaultConfiguringBeanFactoryPostProcessor
private void registerRoleController() {
if (!this.beanFactory.containsBean(IntegrationContextUtils.INTEGRATION_LIFECYCLE_ROLE_CONTROLLER)) {
this.registry.registerBeanDefinition(IntegrationContextUtils.INTEGRATION_LIFECYCLE_ROLE_CONTROLLER,
new RootBeanDefinition(SmartLifecycleRoleController.class, SmartLifecycleRoleController::new));
new RootBeanDefinition(SmartLifecycleRoleController.class));
}
}
@@ -384,7 +373,7 @@ public class DefaultConfiguringBeanFactoryPostProcessor
private void registerMessageBuilderFactory() {
if (!this.beanFactory.containsBean(IntegrationUtils.INTEGRATION_MESSAGE_BUILDER_FACTORY_BEAN_NAME)) {
BeanDefinitionBuilder mbfBuilder = BeanDefinitionBuilder
.genericBeanDefinition(DefaultMessageBuilderFactory.class, DefaultMessageBuilderFactory::new)
.genericBeanDefinition(DefaultMessageBuilderFactory.class)
.addPropertyValue("readOnlyHeaders",
IntegrationProperties.getExpressionFor(IntegrationProperties.READ_ONLY_HEADERS));
this.registry.registerBeanDefinition(
@@ -401,7 +390,7 @@ public class DefaultConfiguringBeanFactoryPostProcessor
"' has been explicitly defined. Therefore, a default DefaultHeaderChannelRegistry will be created.");
this.registry.registerBeanDefinition(IntegrationContextUtils.INTEGRATION_HEADER_CHANNEL_REGISTRY_BEAN_NAME,
new RootBeanDefinition(DefaultHeaderChannelRegistry.class, DefaultHeaderChannelRegistry::new));
new RootBeanDefinition(DefaultHeaderChannelRegistry.class));
}
}
@@ -412,8 +401,7 @@ public class DefaultConfiguringBeanFactoryPostProcessor
if (!this.registry.containsBeanDefinition(
IntegrationContextUtils.GLOBAL_CHANNEL_INTERCEPTOR_PROCESSOR_BEAN_NAME)) {
BeanDefinitionBuilder builder =
BeanDefinitionBuilder.genericBeanDefinition(GlobalChannelInterceptorProcessor.class,
GlobalChannelInterceptorProcessor::new)
BeanDefinitionBuilder.genericBeanDefinition(GlobalChannelInterceptorProcessor.class)
.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
this.registry.registerBeanDefinition(IntegrationContextUtils.GLOBAL_CHANNEL_INTERCEPTOR_PROCESSOR_BEAN_NAME,
@@ -430,8 +418,7 @@ public class DefaultConfiguringBeanFactoryPostProcessor
this.registry.registerBeanDefinition(
IntegrationContextUtils.INTEGRATION_DATATYPE_CHANNEL_MESSAGE_CONVERTER_BEAN_NAME,
new RootBeanDefinition(DefaultDatatypeChannelMessageConverter.class,
DefaultDatatypeChannelMessageConverter::new));
new RootBeanDefinition(DefaultDatatypeChannelMessageConverter.class));
}
}
@@ -442,8 +429,7 @@ public class DefaultConfiguringBeanFactoryPostProcessor
private void registerArgumentResolverMessageConverter() {
if (!this.beanFactory.containsBean(IntegrationContextUtils.ARGUMENT_RESOLVER_MESSAGE_CONVERTER_BEAN_NAME)) {
this.registry.registerBeanDefinition(IntegrationContextUtils.ARGUMENT_RESOLVER_MESSAGE_CONVERTER_BEAN_NAME,
new RootBeanDefinition(ConfigurableCompositeMessageConverter.class,
ConfigurableCompositeMessageConverter::new));
new RootBeanDefinition(ConfigurableCompositeMessageConverter.class));
}
}
@@ -466,8 +452,7 @@ public class DefaultConfiguringBeanFactoryPostProcessor
}
private static BeanDefinitionBuilder createMessageHandlerMethodFactoryBeanDefinition(boolean listCapable) {
return BeanDefinitionBuilder.genericBeanDefinition(IntegrationMessageHandlerMethodFactory.class,
() -> new IntegrationMessageHandlerMethodFactory(listCapable))
return BeanDefinitionBuilder.genericBeanDefinition(IntegrationMessageHandlerMethodFactory.class)
.addConstructorArgValue(listCapable)
.addPropertyReference("messageConverter",
IntegrationContextUtils.ARGUMENT_RESOLVER_MESSAGE_CONVERTER_BEAN_NAME);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2022 the original author or authors.
* Copyright 2014-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -45,6 +45,7 @@ import org.springframework.util.StringUtils;
* to Consumer Endpoints are present.
*
* @author Artem Bilan
* @author Chris Bono
*
* @since 4.1
*/
@@ -83,8 +84,7 @@ public class IdempotentReceiverAutoProxyCreatorInitializer implements Integratio
if (!idempotentEndpointsMapping.isEmpty()) {
BeanDefinition bd =
BeanDefinitionBuilder.rootBeanDefinition(IdempotentReceiverAutoProxyCreator.class,
IdempotentReceiverAutoProxyCreator::new)
BeanDefinitionBuilder.rootBeanDefinition(IdempotentReceiverAutoProxyCreator.class)
.addPropertyValue("idempotentEndpointsMapping", idempotentEndpointsMapping)
.getBeanDefinition();
registry.registerBeanDefinition(IDEMPOTENT_RECEIVER_AUTO_PROXY_CREATOR_BEAN_NAME, bd);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2022 the original author or authors.
* Copyright 2014-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -65,6 +65,7 @@ import org.springframework.util.StringUtils;
*
* @author Artem Bilan
* @author Gary Russell
* @author Chris Bono
*
* @since 4.0
*/
@@ -109,7 +110,7 @@ public class IntegrationComponentScanRegistrar implements ImportBeanDefinitionRe
}
registry.registerBeanDefinition(BEAN_NAME,
BeanDefinitionBuilder.genericBeanDefinition(IntegrationComponentScanRegistrar.class, () -> this)
BeanDefinitionBuilder.genericBeanDefinition(IntegrationComponentScanRegistrar.class)
.setRole(BeanDefinition.ROLE_INFRASTRUCTURE)
.getBeanDefinition());

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2022 the original author or authors.
* Copyright 2014-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,6 +29,7 @@ import org.springframework.integration.channel.DirectChannel;
* Shared utility methods for Integration configuration.
*
* @author Artem Bilan
* @author Chris Bono
*
* @since 4.0
*/
@@ -57,15 +58,14 @@ public final class IntegrationConfigUtils {
String methodSignature) {
BeanDefinitionBuilder builder =
BeanDefinitionBuilder.genericBeanDefinition(SpelFunctionFactoryBean.class,
() -> new SpelFunctionFactoryBean(aClass, methodSignature))
BeanDefinitionBuilder.genericBeanDefinition(SpelFunctionFactoryBean.class)
.addConstructorArgValue(aClass)
.addConstructorArgValue(methodSignature);
registry.registerBeanDefinition(functionId, builder.getBeanDefinition());
}
public static void autoCreateDirectChannel(String channelName, BeanDefinitionRegistry registry) {
registry.registerBeanDefinition(channelName, new RootBeanDefinition(DirectChannel.class, DirectChannel::new));
registry.registerBeanDefinition(channelName, new RootBeanDefinition(DirectChannel.class));
}
public static BeanNameGenerator annotationBeanNameGenerator(BeanDefinitionRegistry registry) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2022 the original author or authors.
* Copyright 2014-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -38,6 +38,7 @@ import org.springframework.integration.support.utils.IntegrationUtils;
*
* @author Artem Bilan
* @author Gary Russell
* @author Chris Bono
*
* @since 4.0
*/
@@ -60,13 +61,12 @@ public class IntegrationConverterInitializer implements IntegrationConfiguration
if (!registry.containsBeanDefinition(IntegrationContextUtils.CONVERTER_REGISTRAR_BEAN_NAME)) {
registry.registerBeanDefinition(IntegrationContextUtils.CONVERTER_REGISTRAR_BEAN_NAME,
new RootBeanDefinition(ConverterRegistrar.class, ConverterRegistrar::new));
new RootBeanDefinition(ConverterRegistrar.class));
}
if (!registry.containsBeanDefinition(IntegrationUtils.INTEGRATION_CONVERSION_SERVICE_BEAN_NAME)) {
registry.registerBeanDefinition(IntegrationUtils.INTEGRATION_CONVERSION_SERVICE_BEAN_NAME,
new RootBeanDefinition(CustomConversionServiceFactoryBean.class,
CustomConversionServiceFactoryBean::new));
new RootBeanDefinition(CustomConversionServiceFactoryBean.class));
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2022 the original author or authors.
* Copyright 2014-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,6 +31,7 @@ import org.springframework.util.ClassUtils;
*
* @author Artem Bilan
* @author Gary Russell
* @author Chris Bono
*
* @since 4.0
*/
@@ -73,8 +74,7 @@ public class IntegrationRegistrar implements ImportBeanDefinitionRegistrar {
private void registerDefaultConfiguringBeanFactoryPostProcessor(BeanDefinitionRegistry registry) {
if (!registry.containsBeanDefinition(IntegrationContextUtils.DEFAULT_CONFIGURING_POSTPROCESSOR_BEAN_NAME)) {
BeanDefinitionBuilder postProcessorBuilder =
BeanDefinitionBuilder.genericBeanDefinition(DefaultConfiguringBeanFactoryPostProcessor.class,
DefaultConfiguringBeanFactoryPostProcessor::new)
BeanDefinitionBuilder.genericBeanDefinition(DefaultConfiguringBeanFactoryPostProcessor.class)
.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
registry.registerBeanDefinition(IntegrationContextUtils.DEFAULT_CONFIGURING_POSTPROCESSOR_BEAN_NAME,
postProcessorBuilder.getBeanDefinition());
@@ -90,8 +90,7 @@ public class IntegrationRegistrar implements ImportBeanDefinitionRegistrar {
IntegrationContextUtils.INTEGRATION_CONFIGURATION_POST_PROCESSOR_BEAN_NAME)) {
BeanDefinitionBuilder postProcessorBuilder =
BeanDefinitionBuilder.genericBeanDefinition(IntegrationConfigurationBeanFactoryPostProcessor.class,
IntegrationConfigurationBeanFactoryPostProcessor::new)
BeanDefinitionBuilder.genericBeanDefinition(IntegrationConfigurationBeanFactoryPostProcessor.class)
.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
registry.registerBeanDefinition(IntegrationContextUtils.INTEGRATION_CONFIGURATION_POST_PROCESSOR_BEAN_NAME,
postProcessorBuilder.getBeanDefinition());
@@ -108,8 +107,7 @@ public class IntegrationRegistrar implements ImportBeanDefinitionRegistrar {
private void registerMessagingAnnotationPostProcessors(BeanDefinitionRegistry registry) {
if (!registry.containsBeanDefinition(IntegrationContextUtils.MESSAGING_ANNOTATION_POSTPROCESSOR_NAME)) {
BeanDefinitionBuilder builder =
BeanDefinitionBuilder.genericBeanDefinition(MessagingAnnotationPostProcessor.class,
MessagingAnnotationPostProcessor::new)
BeanDefinitionBuilder.genericBeanDefinition(MessagingAnnotationPostProcessor.class)
.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
registry.registerBeanDefinition(IntegrationContextUtils.MESSAGING_ANNOTATION_POSTPROCESSOR_NAME,

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2021 the original author or authors.
* Copyright 2014-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -35,6 +35,7 @@ import org.springframework.integration.history.MessageHistoryConfigurer;
*
* @author Artem Bilan
* @author Gary Russell
* @author Chris Bono
*
* @since 4.0
*/
@@ -61,8 +62,7 @@ public class MessageHistoryRegistrar implements ImportBeanDefinitionRegistrar {
}
BeanDefinition messageHistoryConfigurer =
BeanDefinitionBuilder.genericBeanDefinition(MessageHistoryConfigurer.class,
MessageHistoryConfigurer::new)
BeanDefinitionBuilder.genericBeanDefinition(MessageHistoryConfigurer.class)
.addPropertyValue("componentNamePatterns", patterns)
.getBeanDefinition();

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2021 the original author or authors.
* Copyright 2014-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,6 +32,7 @@ import org.springframework.util.StringUtils;
/**
* @author Artem Bilan
* @author Gary Russell
* @author Chris Bono
*
* @since 4.0
*/
@@ -52,8 +53,7 @@ public class PublisherRegistrar implements ImportBeanDefinitionRegistrar {
: (String) annotationAttributes.get("defaultChannel");
BeanDefinitionBuilder builder =
BeanDefinitionBuilder.genericBeanDefinition(PublisherAnnotationBeanPostProcessor.class,
PublisherAnnotationBeanPostProcessor::new)
BeanDefinitionBuilder.genericBeanDefinition(PublisherAnnotationBeanPostProcessor.class)
.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
if (StringUtils.hasText(defaultChannel)) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -269,7 +269,7 @@ public class GatewayParser implements BeanDefinitionParser {
Map<String, Object>[] defaultHeaders) {
BeanDefinitionBuilder methodMetadataBuilder =
BeanDefinitionBuilder.genericBeanDefinition(GatewayMethodMetadata.class, GatewayMethodMetadata::new);
BeanDefinitionBuilder.genericBeanDefinition(GatewayMethodMetadata.class);
if (StringUtils.hasText(defaultPayloadExpression)) {
methodMetadataBuilder.addPropertyValue("payloadExpression",

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2016-2021 the original author or authors.
* Copyright 2016-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -35,6 +35,7 @@ import org.springframework.util.Assert;
*
* @author Artem Bilan
* @author Gary Russell
* @author Chris Bono
* @since 5.0
*
* @see org.springframework.integration.config.IntegrationConfigurationBeanFactoryPostProcessor
@@ -60,13 +61,11 @@ public class DslIntegrationConfigurationInitializer implements IntegrationConfig
BeanDefinitionRegistry registry = (BeanDefinitionRegistry) configurableListableBeanFactory;
if (!registry.containsBeanDefinition(INTEGRATION_FLOW_BPP_BEAN_NAME)) {
registry.registerBeanDefinition(INTEGRATION_FLOW_BPP_BEAN_NAME,
new RootBeanDefinition(IntegrationFlowBeanPostProcessor.class,
IntegrationFlowBeanPostProcessor::new));
new RootBeanDefinition(IntegrationFlowBeanPostProcessor.class));
registry.registerBeanDefinition(INTEGRATION_FLOW_CONTEXT_BEAN_NAME,
new RootBeanDefinition(StandardIntegrationFlowContext.class, StandardIntegrationFlowContext::new));
new RootBeanDefinition(StandardIntegrationFlowContext.class));
registry.registerBeanDefinition(INTEGRATION_FLOW_REPLY_PRODUCER_CLEANER_BEAN_NAME,
new RootBeanDefinition(IntegrationFlowDefinition.ReplyProducerCleaner.class,
IntegrationFlowDefinition.ReplyProducerCleaner::new));
new RootBeanDefinition(IntegrationFlowDefinition.ReplyProducerCleaner.class));
}
}