From ad546ccd43fab874cddcde3268ade062ee7f8534 Mon Sep 17 00:00:00 2001 From: Mark Fisher Date: Fri, 30 Apr 2010 23:23:38 +0000 Subject: [PATCH] INT-842 removed AbstractRemotingGatewayParser from 'adapter' module --- .../config/AbstractRemotingGatewayParser.java | 77 ------------------- 1 file changed, 77 deletions(-) delete mode 100644 org.springframework.integration.adapter/src/main/java/org/springframework/integration/adapter/config/AbstractRemotingGatewayParser.java diff --git a/org.springframework.integration.adapter/src/main/java/org/springframework/integration/adapter/config/AbstractRemotingGatewayParser.java b/org.springframework.integration.adapter/src/main/java/org/springframework/integration/adapter/config/AbstractRemotingGatewayParser.java deleted file mode 100644 index 6c8b08f882..0000000000 --- a/org.springframework.integration.adapter/src/main/java/org/springframework/integration/adapter/config/AbstractRemotingGatewayParser.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright 2002-2008 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.adapter.config; - -import org.w3c.dom.Element; - -import org.springframework.beans.factory.BeanDefinitionStoreException; -import org.springframework.beans.factory.support.AbstractBeanDefinition; -import org.springframework.beans.factory.support.BeanDefinitionBuilder; -import org.springframework.beans.factory.xml.AbstractSimpleBeanDefinitionParser; -import org.springframework.beans.factory.xml.ParserContext; -import org.springframework.util.Assert; -import org.springframework.util.StringUtils; - -/** - * Base class for remoting gateway parsers. - * - * @author Mark Fisher - */ -public abstract class AbstractRemotingGatewayParser extends AbstractSimpleBeanDefinitionParser { - - @Override - protected String resolveId(Element element, AbstractBeanDefinition definition, ParserContext parserContext) - throws BeanDefinitionStoreException { - String id = super.resolveId(element, definition, parserContext); - if (!StringUtils.hasText(id)) { - id = element.getAttribute("name"); - } - if (!StringUtils.hasText(id)) { - id = parserContext.getReaderContext().generateBeanName(definition); - } - return id; - } - - @Override - protected boolean isEligibleAttribute(String attributeName) { - return !attributeName.equals("name") && !attributeName.equals("request-channel") - && !attributeName.equals("reply-channel") && super.isEligibleAttribute(attributeName); - } - - @Override - protected final void postProcess(BeanDefinitionBuilder builder, Element element) { - String requestChannelRef = element.getAttribute("request-channel"); - Assert.hasText(requestChannelRef, "a 'request-channel' reference is required"); - builder.addPropertyReference("requestChannel", requestChannelRef); - String replyChannel = element.getAttribute("reply-channel"); - if (StringUtils.hasText(replyChannel)) { - builder.addPropertyReference("replyChannel", replyChannel); - } - String autoStartup = element.getAttribute("auto-startup"); - if (StringUtils.hasText(autoStartup)) { - builder.addPropertyValue("autoStartup", autoStartup); - } - this.doPostProcess(builder, element); - } - - /** - * Subclasses may add to the bean definition by overriding this method. - */ - protected void doPostProcess(BeanDefinitionBuilder builder, Element element) { - } - -}