diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index a4922b2608..6b6ea3ab4f 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 54b71bd52c..0e680f3759 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Wed Sep 06 12:46:29 EDT 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.3.1-bin.zip diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/AbstractIntegrationNamespaceHandler.java b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/AbstractIntegrationNamespaceHandler.java index 510ccae28e..8633168fcf 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/AbstractIntegrationNamespaceHandler.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/AbstractIntegrationNamespaceHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * Copyright 2002-2017 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. @@ -16,6 +16,8 @@ package org.springframework.integration.config.xml; +import java.util.concurrent.atomic.AtomicBoolean; + import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.w3c.dom.Element; @@ -42,24 +44,29 @@ import org.springframework.util.StringUtils; */ public abstract class AbstractIntegrationNamespaceHandler implements NamespaceHandler { - protected final Log logger = LogFactory.getLog(this.getClass()); - private static final String VERSION = "5.0"; + protected final Log logger = LogFactory.getLog(this.getClass()); + private final NamespaceHandlerDelegate delegate = new NamespaceHandlerDelegate(); + private final AtomicBoolean initialized = new AtomicBoolean(); @Override public final BeanDefinition parse(Element element, ParserContext parserContext) { - this.verifySchemaVersion(element, parserContext); - IntegrationRegistrar integrationRegistrar = new IntegrationRegistrar(); - integrationRegistrar.setBeanClassLoader(parserContext.getReaderContext().getBeanClassLoader()); - integrationRegistrar.registerBeanDefinitions(null, parserContext.getRegistry()); + if (!this.initialized.getAndSet(true)) { + verifySchemaVersion(element, parserContext); + IntegrationRegistrar integrationRegistrar = new IntegrationRegistrar(); + integrationRegistrar.setBeanClassLoader(parserContext.getReaderContext().getBeanClassLoader()); + integrationRegistrar.registerBeanDefinitions(null, parserContext.getRegistry()); + } return this.delegate.parse(element, parserContext); } @Override - public final BeanDefinitionHolder decorate(Node source, BeanDefinitionHolder definition, ParserContext parserContext) { + public final BeanDefinitionHolder decorate(Node source, BeanDefinitionHolder definition, + ParserContext parserContext) { + return this.delegate.decorate(source, definition, parserContext); } @@ -67,7 +74,9 @@ public abstract class AbstractIntegrationNamespaceHandler implements NamespaceHa this.delegate.doRegisterBeanDefinitionDecorator(elementName, decorator); } - protected final void registerBeanDefinitionDecoratorForAttribute(String attributeName, BeanDefinitionDecorator decorator) { + protected final void registerBeanDefinitionDecoratorForAttribute(String attributeName, + BeanDefinitionDecorator decorator) { + this.delegate.doRegisterBeanDefinitionDecoratorForAttribute(attributeName, decorator); } @@ -79,7 +88,8 @@ public abstract class AbstractIntegrationNamespaceHandler implements NamespaceHa if (!(matchesVersion(element) && matchesVersion(element.getOwnerDocument().getDocumentElement()))) { parserContext.getReaderContext().error( "You cannot use prior versions of Spring Integration schemas with Spring Integration " + VERSION + - ". Please upgrade your schema declarations or use versionless aliases (e.g. spring-integration.xsd).", element); + ". Please upgrade your schema declarations " + + "or use versionless aliases (e.g. spring-integration.xsd).", element); } } @@ -106,7 +116,9 @@ public abstract class AbstractIntegrationNamespaceHandler implements NamespaceHa super.registerBeanDefinitionDecorator(elementName, decorator); } - private void doRegisterBeanDefinitionDecoratorForAttribute(String attributeName, BeanDefinitionDecorator decorator) { + private void doRegisterBeanDefinitionDecoratorForAttribute(String attributeName, + BeanDefinitionDecorator decorator) { + super.registerBeanDefinitionDecoratorForAttribute(attributeName, decorator); } diff --git a/spring-integration-groovy/src/test/java/org/springframework/integration/groovy/GroovyScriptExecutingMessageProcessorTests.java b/spring-integration-groovy/src/test/java/org/springframework/integration/groovy/GroovyScriptExecutingMessageProcessorTests.java index 9af3324e5e..7eee4d85e0 100644 --- a/spring-integration-groovy/src/test/java/org/springframework/integration/groovy/GroovyScriptExecutingMessageProcessorTests.java +++ b/spring-integration-groovy/src/test/java/org/springframework/integration/groovy/GroovyScriptExecutingMessageProcessorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2017 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. @@ -30,6 +30,7 @@ import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; +import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; @@ -52,6 +53,7 @@ import groovy.lang.Script; * @author Dave Syer * @author Oleg Zhurakousky * @author Artem Bilan + * * @since 2.0 */ public class GroovyScriptExecutingMessageProcessorTests { @@ -83,6 +85,7 @@ public class GroovyScriptExecutingMessageProcessorTests { ScriptSource scriptSource = new ResourceScriptSource(resource); Object result = null; class CustomScriptVariableGenerator implements ScriptVariableGenerator { + @Override public Map generateScriptVariables(Message message) { Map variables = new HashMap(); @@ -125,6 +128,7 @@ public class GroovyScriptExecutingMessageProcessorTests { } @Test + @Ignore("Very sensitive to the time") public void testRefreshableScriptExecution() throws Exception { String script = "return \"payload is $payload, header is $headers.testHeader\""; Message message = MessageBuilder.withPayload("foo").setHeader("testHeader", "bar").build(); @@ -134,7 +138,7 @@ public class GroovyScriptExecutingMessageProcessorTests { // should be the original script Object result = processor.processMessage(message); assertEquals("payload is foo, header is bar", result.toString()); - //reset the script with the new strimg + //reset the script with the new string resource.setScript("return \"payload is $payload\""); Thread.sleep(20L); // should still assert to the old script because not enough time elapsed for refresh to kick in