diff --git a/spring-eai-core/src/main/java/org/springframework/integration/config/AnnotationDrivenParser.java b/spring-eai-core/src/main/java/org/springframework/integration/config/AnnotationDrivenParser.java index ea18ce5b4d..a6773ae0bd 100644 --- a/spring-eai-core/src/main/java/org/springframework/integration/config/AnnotationDrivenParser.java +++ b/spring-eai-core/src/main/java/org/springframework/integration/config/AnnotationDrivenParser.java @@ -27,6 +27,9 @@ import org.springframework.beans.factory.xml.ParserContext; import org.springframework.integration.endpoint.annotation.MessageEndpointAnnotationPostProcessor; /** + * Parser for the annotation-driven element of the integration + * namespace. Registers the annotation-driven post-processors. + * * @author Mark Fisher */ public class AnnotationDrivenParser implements BeanDefinitionParser { diff --git a/spring-eai-core/src/main/java/org/springframework/integration/config/AbstractChannelAdapterParser.java b/spring-eai-core/src/main/java/org/springframework/integration/config/ChannelAdapterParser.java similarity index 90% rename from spring-eai-core/src/main/java/org/springframework/integration/config/AbstractChannelAdapterParser.java rename to spring-eai-core/src/main/java/org/springframework/integration/config/ChannelAdapterParser.java index 91fb7bb5ce..2c2d71f982 100644 --- a/spring-eai-core/src/main/java/org/springframework/integration/config/AbstractChannelAdapterParser.java +++ b/spring-eai-core/src/main/java/org/springframework/integration/config/ChannelAdapterParser.java @@ -29,11 +29,11 @@ import org.springframework.integration.endpoint.OutboundMethodInvokingChannelAda import org.springframework.util.StringUtils; /** - * Base parser for inbound and outbound channel adapters. + * Parser for inbound and outbound channel adapters. * * @author Mark Fisher */ -public abstract class AbstractChannelAdapterParser implements BeanDefinitionParser { +public class ChannelAdapterParser implements BeanDefinitionParser { private static final String ID_ATTRIBUTE = "id"; @@ -42,9 +42,17 @@ public abstract class AbstractChannelAdapterParser implements BeanDefinitionPars private static final String METHOD_ATTRIBUTE = "method"; + private final boolean isInbound; + + + public ChannelAdapterParser(boolean isInbound) { + this.isInbound = isInbound; + } + + public BeanDefinition parse(Element element, ParserContext parserContext) { RootBeanDefinition adapterDef = null; - if (this.isInbound()) { + if (this.isInbound) { adapterDef = new RootBeanDefinition(InboundMethodInvokingChannelAdapter.class); } else { @@ -65,6 +73,4 @@ public abstract class AbstractChannelAdapterParser implements BeanDefinitionPars return adapterDef; } - protected abstract boolean isInbound(); - } diff --git a/spring-eai-core/src/main/java/org/springframework/integration/config/InboundChannelAdapterParser.java b/spring-eai-core/src/main/java/org/springframework/integration/config/InboundChannelAdapterParser.java deleted file mode 100644 index 362f9469df..0000000000 --- a/spring-eai-core/src/main/java/org/springframework/integration/config/InboundChannelAdapterParser.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2002-2007 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.integration.config; - -/** - * @author Mark Fisher - */ -public class InboundChannelAdapterParser extends AbstractChannelAdapterParser { - - @Override - protected boolean isInbound() { - return true; - } - -} diff --git a/spring-eai-core/src/main/java/org/springframework/integration/config/IntegrationNamespaceHandler.java b/spring-eai-core/src/main/java/org/springframework/integration/config/IntegrationNamespaceHandler.java index ae7fab3a6f..a72f6687bc 100644 --- a/spring-eai-core/src/main/java/org/springframework/integration/config/IntegrationNamespaceHandler.java +++ b/spring-eai-core/src/main/java/org/springframework/integration/config/IntegrationNamespaceHandler.java @@ -29,8 +29,8 @@ public class IntegrationNamespaceHandler extends NamespaceHandlerSupport { registerBeanDefinitionParser("message-bus", new MessageBusParser()); registerBeanDefinitionParser("annotation-driven", new AnnotationDrivenParser()); registerBeanDefinitionParser("channel", new ChannelParser()); - registerBeanDefinitionParser("inbound-channel-adapter", new InboundChannelAdapterParser()); - registerBeanDefinitionParser("outbound-channel-adapter", new OutboundChannelAdapterParser()); + registerBeanDefinitionParser("inbound-channel-adapter", new ChannelAdapterParser(true)); + registerBeanDefinitionParser("outbound-channel-adapter", new ChannelAdapterParser(false)); registerBeanDefinitionParser("endpoint", new EndpointParser()); } diff --git a/spring-eai-core/src/main/java/org/springframework/integration/config/OutboundChannelAdapterParser.java b/spring-eai-core/src/main/java/org/springframework/integration/config/OutboundChannelAdapterParser.java deleted file mode 100644 index 154718dfe2..0000000000 --- a/spring-eai-core/src/main/java/org/springframework/integration/config/OutboundChannelAdapterParser.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2002-2007 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.integration.config; - -/** - * @author Mark Fisher - */ -public class OutboundChannelAdapterParser extends AbstractChannelAdapterParser { - - @Override - protected boolean isInbound() { - return false; - } - -}