diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/AbstractSimpleMessageHandlerFactoryBean.java b/spring-integration-core/src/main/java/org/springframework/integration/config/AbstractSimpleMessageHandlerFactoryBean.java index 5ac7c421a04..4b3f54199e8 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/AbstractSimpleMessageHandlerFactoryBean.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/AbstractSimpleMessageHandlerFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2020 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. @@ -204,7 +204,7 @@ protected final H createHandlerInternal() { getBeanFactory(), factory -> ((BeanFactoryAware) this.handler).setBeanFactory(factory)) .acceptIfCondition(this.handler instanceof BeanNameAware && this.beanName != null, this.beanName, - namne -> ((BeanNameAware) this.handler).setBeanName(this.beanName)) + name -> ((BeanNameAware) this.handler).setBeanName(this.beanName)) .acceptIfCondition(this.handler instanceof ApplicationEventPublisherAware && this.applicationEventPublisher != null, this.applicationEventPublisher, diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/config/FileReadingMessageSourceFactoryBean.java b/spring-integration-file/src/main/java/org/springframework/integration/file/config/FileReadingMessageSourceFactoryBean.java index 889fd78a67f..578376f579a 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/config/FileReadingMessageSourceFactoryBean.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/config/FileReadingMessageSourceFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2020 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. @@ -21,6 +21,7 @@ import java.util.Comparator; import org.springframework.beans.factory.BeanFactory; +import org.springframework.beans.factory.BeanNameAware; import org.springframework.beans.factory.config.AbstractFactoryBean; import org.springframework.integration.file.DirectoryScanner; import org.springframework.integration.file.FileReadingMessageSource; @@ -37,7 +38,8 @@ * * @since 1.0.3 */ -public class FileReadingMessageSourceFactoryBean extends AbstractFactoryBean { +public class FileReadingMessageSourceFactoryBean extends AbstractFactoryBean + implements BeanNameAware { private FileReadingMessageSource source; @@ -61,6 +63,13 @@ public class FileReadingMessageSourceFactoryBean extends AbstractFactoryBean { +public class JpaOutboundGatewayFactoryBean extends AbstractSimpleMessageHandlerFactoryBean { private JpaExecutor jpaExecutor; private OutboundGatewayType gatewayType = OutboundGatewayType.UPDATING; - /** - * <request-handler-advice-chain /> only applies to the handleRequestMessage. - */ - private List adviceChain; - private boolean producesReply = true; - private MessageChannel outputChannel; - - private int order; - private long replyTimeout; private boolean requiresReply = false; - private String componentName; - - public JpaOutboundGatewayFactoryBean() { - } - public void setJpaExecutor(JpaExecutor jpaExecutor) { this.jpaExecutor = jpaExecutor; } @@ -75,22 +55,10 @@ public void setGatewayType(OutboundGatewayType gatewayType) { this.gatewayType = gatewayType; } - public void setAdviceChain(List adviceChain) { - this.adviceChain = adviceChain; - } - public void setProducesReply(boolean producesReply) { this.producesReply = producesReply; } - public void setOutputChannel(MessageChannel outputChannel) { - this.outputChannel = outputChannel; - } - - public void setOrder(int order) { - this.order = order; - } - /** * Specifies the time the gateway will wait to send the result to the reply channel. * Only applies when the reply channel itself might block the send @@ -106,37 +74,13 @@ public void setRequiresReply(boolean requiresReply) { this.requiresReply = requiresReply; } - /** - * Sets the name of the handler component. - * @param componentName The component name. - */ - public void setComponentName(String componentName) { - this.componentName = componentName; - } - - @Override - public Class getObjectType() { - return MessageHandler.class; - } - @Override - protected JpaOutboundGateway createInstance() { + protected JpaOutboundGateway createHandler() { JpaOutboundGateway jpaOutboundGateway = new JpaOutboundGateway(this.jpaExecutor); jpaOutboundGateway.setGatewayType(this.gatewayType); jpaOutboundGateway.setProducesReply(this.producesReply); - jpaOutboundGateway.setOutputChannel(this.outputChannel); - jpaOutboundGateway.setOrder(this.order); jpaOutboundGateway.setSendTimeout(this.replyTimeout); jpaOutboundGateway.setRequiresReply(this.requiresReply); - jpaOutboundGateway.setComponentName(this.componentName); - if (this.adviceChain != null) { - jpaOutboundGateway.setAdviceChain(this.adviceChain); - } - BeanFactory beanFactory = getBeanFactory(); - if (beanFactory != null) { - jpaOutboundGateway.setBeanFactory(beanFactory); - } - jpaOutboundGateway.afterPropertiesSet(); return jpaOutboundGateway; }