diff --git a/docs/src/reference/docbook/groovy.xml b/docs/src/reference/docbook/groovy.xml index ead41c03e9..a1124fbebd 100644 --- a/docs/src/reference/docbook/groovy.xml +++ b/docs/src/reference/docbook/groovy.xml @@ -104,15 +104,15 @@ However if you need more dynamics with regard to how a particular variable is generated then all you need to do is - provide your own implementation of ScriptVariableGenerator and inject it via script-variable-source atribute: + provide your own implementation of ScriptVariableGenerator and inject it via script-variable-generator attribute: -]]> + script-variable-generator="scriptVarGenerator"/> +]]> - Remember that script-variable-source and use of <variable> sub-element is mutually exclusive. - You can only use one of another. Also, the script-variable-source and/or <variable> sub-elements can + Remember that script-variable-generator and use of <variable> sub-element is mutually exclusive. + You can only use one of another. Also, the script-variable-generator and/or <variable> sub-elements can not be used when using inline script, only when pointing to the script via location attribute. diff --git a/spring-integration-groovy/src/main/java/org/springframework/integration/groovy/config/GroovyScriptParser.java b/spring-integration-groovy/src/main/java/org/springframework/integration/groovy/config/GroovyScriptParser.java index 720e387864..1447ee5f83 100644 --- a/spring-integration-groovy/src/main/java/org/springframework/integration/groovy/config/GroovyScriptParser.java +++ b/spring-integration-groovy/src/main/java/org/springframework/integration/groovy/config/GroovyScriptParser.java @@ -59,7 +59,7 @@ public class GroovyScriptParser extends AbstractSingleBeanDefinitionParser { } List variableElements = DomUtils.getChildElementsByTagName(element, "variable"); - String scriptVariableSourceName = element.getAttribute("script-variable-source"); + String scriptVariableSourceName = element.getAttribute("script-variable-generator"); if (StringUtils.hasText(scriptText) && (variableElements.size() > 0 || StringUtils.hasText(scriptVariableSourceName))){ parserContext.getReaderContext().error("Variable bindings or custom ScriptVariabelSource are not allowed when using inline groovy script. " + @@ -68,7 +68,7 @@ public class GroovyScriptParser extends AbstractSingleBeanDefinitionParser { } if (StringUtils.hasText(scriptVariableSourceName) && variableElements.size() > 0){ - parserContext.getReaderContext().error("'script-variable-source' and 'variable' sub-element are mutualy exclusive. Must use one or the other.", element); + parserContext.getReaderContext().error("'script-variable-generator' and 'variable' sub-element are mutualy exclusive. Must use one or the other.", element); return; } diff --git a/spring-integration-groovy/src/main/resources/org/springframework/integration/groovy/config/spring-integration-groovy-2.0.xsd b/spring-integration-groovy/src/main/resources/org/springframework/integration/groovy/config/spring-integration-groovy-2.0.xsd index 2e4aebb05b..67b52637d6 100644 --- a/spring-integration-groovy/src/main/resources/org/springframework/integration/groovy/config/spring-integration-groovy-2.0.xsd +++ b/spring-integration-groovy/src/main/resources/org/springframework/integration/groovy/config/spring-integration-groovy-2.0.xsd @@ -20,7 +20,7 @@ Allows you to define custom Groovy variable bindings. The use of this sub-element is mutually - exclusive with 'script-variable-source' attribute + exclusive with 'script-variable-generator' attribute @@ -59,14 +59,14 @@ - + Reference to the ScriptVariableSource bean. This attribute is mutually exclusive with 'variable' sub-element - + diff --git a/spring-integration-groovy/src/test/java/org/springframework/integration/groovy/config/GroovyServiceActivatorTests-context.xml b/spring-integration-groovy/src/test/java/org/springframework/integration/groovy/config/GroovyServiceActivatorTests-context.xml index 9113656777..6ec84a01a9 100644 --- a/spring-integration-groovy/src/test/java/org/springframework/integration/groovy/config/GroovyServiceActivatorTests-context.xml +++ b/spring-integration-groovy/src/test/java/org/springframework/integration/groovy/config/GroovyServiceActivatorTests-context.xml @@ -20,7 +20,7 @@ + script-variable-generator="scriptVarSource"/> + script-variable-generator="scriptVarSource"> diff --git a/spring-integration-groovy/src/test/java/org/springframework/integration/groovy/config/GroovyServiceActivatorTests.java b/spring-integration-groovy/src/test/java/org/springframework/integration/groovy/config/GroovyServiceActivatorTests.java index c65481d8af..4400df2075 100644 --- a/spring-integration-groovy/src/test/java/org/springframework/integration/groovy/config/GroovyServiceActivatorTests.java +++ b/spring-integration-groovy/src/test/java/org/springframework/integration/groovy/config/GroovyServiceActivatorTests.java @@ -82,7 +82,7 @@ public class GroovyServiceActivatorTests { } @Test - public void withScriptVariableSource() throws Exception{ + public void withScriptVariableGenerator() throws Exception{ QueueChannel replyChannel = new QueueChannel(); replyChannel.setBeanName("returnAddress"); for (int i = 1; i <= 3; i++) { @@ -125,7 +125,7 @@ public class GroovyServiceActivatorTests { @Test(expected=BeanDefinitionParsingException.class) public void variablesAndScriptVariableSource() throws Exception{ - new ClassPathXmlApplicationContext("GroovyServiceActivatorTests-fail-withsource-context.xml", this.getClass()); + new ClassPathXmlApplicationContext("GroovyServiceActivatorTests-fail-withgenerator-context.xml", this.getClass()); } public static class SampleScriptVariSource implements ScriptVariableGenerator{