diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/GlobalChannelInterceptorParser.java b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/GlobalChannelInterceptorParser.java index 9f4a04c467..5b7c74f2af 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/GlobalChannelInterceptorParser.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/GlobalChannelInterceptorParser.java @@ -32,6 +32,7 @@ import org.w3c.dom.Element; * * @author Oleg Zhurakousky * @author Mark Fisher + * @author David Turanski * @since 2.0 */ public class GlobalChannelInterceptorParser extends AbstractBeanDefinitionParser { @@ -51,17 +52,13 @@ public class GlobalChannelInterceptorParser extends AbstractBeanDefinitionParser protected AbstractBeanDefinition parseInternal(Element element, ParserContext parserContext) { + this.createAndRegisterGlobalPostProcessorIfNecessary(parserContext); BeanDefinitionBuilder globalChannelInterceptorBuilder = - BeanDefinitionBuilder.genericBeanDefinition(BASE_PACKAGE + "GlobalChannelInterceptorWrapper"); - BeanComponentDefinition interceptorBeanDefinition = IntegrationNamespaceUtils.parseInnerHandlerDefinition(element, parserContext); - if (interceptorBeanDefinition != null) { - globalChannelInterceptorBuilder.addConstructorArgValue(interceptorBeanDefinition); - } - else { - String beanName = element.getAttribute(REF_ATTRIBUTE); - globalChannelInterceptorBuilder.addConstructorArgValue(new RuntimeBeanReference(beanName)); - } + BeanDefinitionBuilder.genericBeanDefinition(BASE_PACKAGE + "GlobalChannelInterceptorWrapper"); + + globalChannelInterceptorBuilder.addConstructorArgValue(getBeanDefinitionBuilderConstructorValue(element, parserContext)); + IntegrationNamespaceUtils.setValueIfAttributeDefined(globalChannelInterceptorBuilder, element, "order"); IntegrationNamespaceUtils.setValueIfAttributeDefined(globalChannelInterceptorBuilder, element, CHANNEL_NAME_PATTERN_ATTRIBUTE, "patterns"); @@ -84,5 +81,15 @@ public class GlobalChannelInterceptorParser extends AbstractBeanDefinitionParser this.postProcessorCreated = true; } } - + + protected Object getBeanDefinitionBuilderConstructorValue(Element element, ParserContext parserContext){ + BeanComponentDefinition interceptorBeanDefinition = IntegrationNamespaceUtils.parseInnerHandlerDefinition(element, parserContext); + if (interceptorBeanDefinition != null) { + return interceptorBeanDefinition; + } + else { + String beanName = element.getAttribute(REF_ATTRIBUTE); + return new RuntimeBeanReference(beanName); + } + } } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/IntegrationNamespaceHandler.java b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/IntegrationNamespaceHandler.java index 5734883550..65c2fa222a 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/IntegrationNamespaceHandler.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/IntegrationNamespaceHandler.java @@ -22,6 +22,7 @@ package org.springframework.integration.config.xml; * @author Mark Fisher * @author Marius Bogoevici * @author Oleg Zhurakousky + * @author David Turanski */ public class IntegrationNamespaceHandler extends AbstractIntegrationNamespaceHandler { @@ -67,6 +68,7 @@ public class IntegrationNamespaceHandler extends AbstractIntegrationNamespaceHan registerBeanDefinitionParser("converter", new ConverterParser()); registerBeanDefinitionParser("message-history", new MessageHistoryParser()); registerBeanDefinitionParser("control-bus", new ControlBusParser()); + registerBeanDefinitionParser("wire-tap", new GlobalWireTapParser()); } } diff --git a/spring-integration-core/src/main/resources/org/springframework/integration/config/xml/spring-integration-2.0.xsd b/spring-integration-core/src/main/resources/org/springframework/integration/config/xml/spring-integration-2.0.xsd index 6974593944..ac9e23709d 100644 --- a/spring-integration-core/src/main/resources/org/springframework/integration/config/xml/spring-integration-2.0.xsd +++ b/spring-integration-core/src/main/resources/org/springframework/integration/config/xml/spring-integration-2.0.xsd @@ -2577,7 +2577,7 @@ Name of the header whose value will be used to route messages Alows you to configure a Wire Tap interceptor that will send a copy of the message to a - channel identified by 'ref' attribute. + channel identified by 'channel' attribute. @@ -2786,6 +2786,25 @@ Name of the header whose value will be used to route messages + + + + + + + + [REQUIRED] Channel name(s) or patterns. To specify more than one channel use + ','  + (e.g., + channel-name-pattern="input*, foo, bar") + + + + + + + +