Moved scripting support from core to scripting

spring-integration-test: Enhanced RequestResponseScenario test framework

 changed scripting namespace URIs to standard pattern
This commit is contained in:
David Turanski
2011-09-21 06:20:28 -04:00
committed by Mark Fisher
parent b6294fc602
commit 08f81ae51d
33 changed files with 123 additions and 52 deletions

View File

@@ -0,0 +1,75 @@
/*
* Copyright 2002-2011 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.scripting;
import java.util.Map;
import org.springframework.integration.Message;
import org.springframework.integration.MessageHandlingException;
import org.springframework.integration.handler.MessageProcessor;
import org.springframework.scripting.ScriptSource;
import org.springframework.util.Assert;
/**
* Base {@link MessageProcessor} for scripting implementations to extend.
*
* @author Mark Fisher
* @since 2.0
*/
public abstract class AbstractScriptExecutingMessageProcessor<T> implements MessageProcessor<T> {
private final ScriptVariableGenerator scriptVariableGenerator;
protected AbstractScriptExecutingMessageProcessor() {
this.scriptVariableGenerator = new DefaultScriptVariableGenerator();
}
protected AbstractScriptExecutingMessageProcessor(ScriptVariableGenerator scriptVariableGenerator) {
Assert.notNull(scriptVariableGenerator, "scriptVariableGenerator must not be null");
this.scriptVariableGenerator = scriptVariableGenerator;
}
/**
* Executes the script and returns the result.
*/
public final T processMessage(Message<?> message) {
try {
ScriptSource source = this.getScriptSource(message);
Map<String, Object> variables = this.scriptVariableGenerator.generateScriptVariables(message);
return this.executeScript(source, variables);
}
catch (Exception e) {
throw new MessageHandlingException(message, "failed to execute script", e);
}
}
/**
* Subclasses must implement this method to create a script source,
* optionally using the message to locate or create the script.
*
* @param message the message being processed
* @return a ScriptSource to use to create a script
*/
protected abstract ScriptSource getScriptSource(Message<?> message);
/**
* Subclasses must implement this method. In doing so, the execution context
* for the script should be populated with the provided script variables.
*/
protected abstract T executeScript(ScriptSource scriptSource, Map<String, Object> variables) throws Exception;
}

View File

@@ -0,0 +1,61 @@
/*
* Copyright 2002-2011 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.scripting;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import org.springframework.integration.Message;
import org.springframework.util.CollectionUtils;
/**
* @author Oleg Zhurakousky
* @author Mark Fisher
* @since 2.0.2
*/
public class DefaultScriptVariableGenerator implements ScriptVariableGenerator {
private final Map<String, Object> variableMap;
public DefaultScriptVariableGenerator() {
this.variableMap = Collections.<String, Object>emptyMap();
}
public DefaultScriptVariableGenerator(Map<String, Object> variableMap) {
this.variableMap = variableMap;
}
public Map<String, Object> generateScriptVariables(Message<?> message) {
Map<String, Object> scriptVariables = new HashMap<String, Object>();
// Add Message content
if (message != null) {
scriptVariables.put("payload", message.getPayload());
scriptVariables.put("headers", message.getHeaders());
}
// Add contents of 'variableMap'
if (!CollectionUtils.isEmpty(this.variableMap)) {
for (Map.Entry<String, Object> entry : this.variableMap.entrySet()) {
scriptVariables.put(entry.getKey(), entry.getValue());
}
}
return scriptVariables;
}
}

View File

@@ -0,0 +1,74 @@
/*
* Copyright 2002-2010 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.scripting;
import java.io.IOException;
import java.util.concurrent.atomic.AtomicLong;
import org.springframework.core.io.Resource;
import org.springframework.scripting.ScriptSource;
import org.springframework.scripting.support.ResourceScriptSource;
/**
* @author Dave Syer
* @author Oleg Zhurakousky
* @since 2.0
*/
public class RefreshableResourceScriptSource implements ScriptSource {
private final long refreshDelay;
private final ResourceScriptSource source;
private final AtomicLong lastModifiedChecked = new AtomicLong(System.currentTimeMillis());
private volatile String script;
public RefreshableResourceScriptSource(Resource resource, long refreshDelay) {
this.refreshDelay = refreshDelay;
this.source = new ResourceScriptSource(resource);
try {
this.script = this.source.getScriptAsString();
}
catch (IOException e) {
this.lastModifiedChecked.set(0);
}
}
public String getScriptAsString() throws IOException {
this.script = source.getScriptAsString();
return this.script;
}
public String suggestedClassName() {
return this.source.suggestedClassName();
}
public boolean isModified() {
if (this.refreshDelay < 0) {
return false;
}
long time = System.currentTimeMillis();
if (this.refreshDelay == 0 || (time - this.lastModifiedChecked.get()) > this.refreshDelay) {
this.lastModifiedChecked.set(time);
return this.source.isModified();
}
return false;
}
}

View File

@@ -0,0 +1,31 @@
/*
* Copyright 2002-2011 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.scripting;
import java.util.Map;
import org.springframework.integration.Message;
/**
* @author Oleg Zhurakousky
* @since 2.0.2
*/
public interface ScriptVariableGenerator {
Map<String, Object> generateScriptVariables(Message<?> message);
}

View File

@@ -0,0 +1,133 @@
/*
* Copyright 2002-2011 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.scripting.config;
import java.util.List;
import org.springframework.beans.factory.config.RuntimeBeanReference;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.support.BeanDefinitionReaderUtils;
import org.springframework.beans.factory.support.ManagedMap;
import org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser;
import org.springframework.beans.factory.xml.ParserContext;
import org.springframework.beans.factory.xml.XmlReaderContext;
import org.springframework.integration.config.xml.IntegrationNamespaceUtils;
import org.springframework.scripting.support.StaticScriptSource;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import org.springframework.util.xml.DomUtils;
import org.w3c.dom.Element;
/**
* @author David Turanski
*
*/
public abstract class AbstractScriptParser extends AbstractSingleBeanDefinitionParser {
protected static final String LOCATION_ATTRIBUTE = "location";
protected static final String REFRESH_CHECK_DELAY_ATTRIBUTE = "refresh-check-delay";
protected boolean shouldGenerateIdAsFallback() {
return true;
}
protected abstract String getBeanClassName(Element element);
protected abstract String getScriptSourceClassName();
@Override
protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) {
String scriptLocation = element.getAttribute(LOCATION_ATTRIBUTE);
String scriptText = DomUtils.getTextValue(element);
if (!(StringUtils.hasText(scriptLocation) ^ StringUtils.hasText(scriptText))) {
parserContext.getReaderContext().error("Either the 'location' attribute or inline script text must be provided, but not both.", element);
return;
}
List<Element> variableElements = DomUtils.getChildElementsByTagName(element, "variable");
String scriptVariableGeneratorName = element.getAttribute("script-variable-generator");
if (StringUtils.hasText(scriptText) && (variableElements.size() > 0 || StringUtils.hasText(scriptVariableGeneratorName))) {
parserContext.getReaderContext().error("Variable bindings or custom ScriptVariableGenerator are not allowed when using an inline groovy script. " +
"Specify location of the script via 'location' attribute instead", element);
return;
}
if (StringUtils.hasText(scriptVariableGeneratorName) && variableElements.size() > 0) {
parserContext.getReaderContext().error("'script-variable-generator' and 'variable' sub-elements are mutually exclusive.", element);
return;
}
if (StringUtils.hasText(scriptLocation)) {
builder.addConstructorArgValue(this.resolveScriptLocation(element, parserContext.getReaderContext(), scriptLocation));
}
else {
if (getScriptSourceClassName() != null){
builder.addConstructorArgValue(new StaticScriptSource(scriptText, getScriptSourceClassName()));
} else {
builder.addConstructorArgValue(new StaticScriptSource(scriptText));
}
}
if (!StringUtils.hasText(scriptVariableGeneratorName)) {
BeanDefinitionBuilder scriptVariableGeneratorBuilder =
BeanDefinitionBuilder.genericBeanDefinition("org.springframework.integration.scripting.DefaultScriptVariableGenerator");
ManagedMap<String, Object> variableMap = new ManagedMap<String, Object>();
for (Element childElement : variableElements) {
String variableName = childElement.getAttribute("name");
String variableValue = childElement.getAttribute("value");
String variableRef = childElement.getAttribute("ref");
if (!(StringUtils.hasText(variableValue) ^ StringUtils.hasText(variableRef))) {
parserContext.getReaderContext().error("Exactly one of the 'ref' attribute or 'value' attribute, " +
" is required for element " +
IntegrationNamespaceUtils.createElementDescription(element) + ".", element);
}
if (StringUtils.hasText(variableValue)) {
variableMap.put(variableName, variableValue);
}
else {
variableMap.put(variableName, new RuntimeBeanReference(variableRef));
}
}
if (!CollectionUtils.isEmpty(variableMap)) {
scriptVariableGeneratorBuilder.addConstructorArgValue(variableMap);
}
scriptVariableGeneratorName = BeanDefinitionReaderUtils.registerWithGeneratedName(
scriptVariableGeneratorBuilder.getBeanDefinition(), parserContext.getRegistry());
}
builder.addConstructorArgReference(scriptVariableGeneratorName);
postProcess(builder, element, parserContext);
}
/**
* Subclasses may override this no-op method to provide additional configuration.
*/
protected void postProcess(BeanDefinitionBuilder builder, Element element, ParserContext parserContext) {
}
private Object resolveScriptLocation(Element element, XmlReaderContext readerContext, String scriptLocation) {
String refreshDelayText = element.getAttribute(REFRESH_CHECK_DELAY_ATTRIBUTE);
String beanClassName = "org.springframework.integration.scripting.RefreshableResourceScriptSource";
BeanDefinitionBuilder resourceScriptSourceBuilder =
BeanDefinitionBuilder.genericBeanDefinition(beanClassName);
resourceScriptSourceBuilder.addConstructorArgValue(scriptLocation);
if (StringUtils.hasText(refreshDelayText)) {
resourceScriptSourceBuilder.addConstructorArgValue(refreshDelayText);
}
else {
resourceScriptSourceBuilder.addConstructorArgValue(-1L);
}
return resourceScriptSourceBuilder.getBeanDefinition();
}
}

View File

@@ -18,7 +18,7 @@ package org.springframework.integration.scripting.config.jsr223;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.xml.ParserContext;
import org.springframework.integration.config.xml.AbstractScriptParser;
import org.springframework.integration.scripting.config.AbstractScriptParser;
import org.springframework.integration.scripting.jsr223.DefaultScriptExecutor;
import org.springframework.util.Assert;
import org.w3c.dom.Element;

View File

@@ -1 +1 @@
http\://www.springframework.org/schema/integration/script=org.springframework.integration.scripting.config.jsr223.ScriptNamespaceHandler
http\://www.springframework.org/schema/integration/scripting=org.springframework.integration.scripting.config.jsr223.ScriptNamespaceHandler

View File

@@ -1,2 +1,4 @@
http\://www.springframework.org/schema/integration/script-2.1.xsd=org/springframework/integration/script/config/spring-integration-script-2.1.xsd
http\://www.springframework.org/schema/integration/script.xsd=org/springframework/integration/script/config/spring-integration-script-2.1.xsd
http\://www.springframework.org/schema/integration/scripting/spring-integration-scripting-2.1.xsd=org/springframework/integration/scripting/config/spring-integration-scripting-2.1.xsd
http\://www.springframework.org/schema/integration/scripting/spring-integration-scripting.xsd=org/springframework/integration/scripting/config/spring-integration-scripting-2.1.xsd
http\://www.springframework.org/schema/integration/scripting/spring-integration-scripting-core-2.1.xsd=org/springframework/integration/scripting/config/spring-integration-scripting-core-2.1.xsd
http\://www.springframework.org/schema/integration/scripting/spring-integration-scripting-core.xsd=org/springframework/integration/scripting/config/spring-integration-scripting-core-2.1.xsd

View File

@@ -1,4 +1,4 @@
# Tooling related information for the integration script namespace
http\://www.springframework.org/schema/integration/script@name=integration script Namespace
http\://www.springframework.org/schema/integration/script@prefix=int-script
http\://www.springframework.org/schema/integration/script@icon=org/springframework/integration/script/config/spring-integration-script.gif
# Tooling related information for the integration scripting namespace
http\://www.springframework.org/schema/integration/scripting@name=integration scripting Namespace
http\://www.springframework.org/schema/integration/scripting@prefix=int-script
http\://www.springframework.org/schema/integration/scripting@icon=org/springframework/integration/scripting/config/spring-integration-scripting.gif

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns="http://www.springframework.org/schema/integration/script"
<xsd:schema xmlns="http://www.springframework.org/schema/integration/scripting"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.springframework.org/schema/integration/script"
targetNamespace="http://www.springframework.org/schema/integration/scripting"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xsd:include

View File

@@ -0,0 +1,83 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema
xmlns="http://www.springframework.org/schema/integration/scripting"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:tool="http://www.springframework.org/schema/tool"
xmlns:integration="http://www.springframework.org/schema/integration"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xsd:import namespace="http://www.springframework.org/schema/tool" />
<xsd:import namespace="http://www.springframework.org/schema/integration"
schemaLocation="http://www.springframework.org/schema/integration/spring-integration-2.1.xsd" />
<xsd:complexType name="ScriptType" mixed="true" abstract="true">
<xsd:sequence>
<xsd:element name="variable" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:annotation>
<xsd:documentation>
Allows you to define custom script variable bindings. The use of this
sub-element is mutually
exclusive with the 'script-variable-generator' attribute.
</xsd:documentation>
</xsd:annotation>
<xsd:attribute name="name" type="xsd:string">
<xsd:annotation>
<xsd:documentation>
Name of the script variable.
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="value" type="xsd:string">
<xsd:annotation>
<xsd:documentation>
Value of the script variable as a literal.
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="ref" type="xsd:string">
<xsd:annotation>
<xsd:documentation>
Value of the script variable as a bean reference.
</xsd:documentation>
<xsd:appinfo>
<tool:expected-type type="java.lang.Object" />
</xsd:appinfo>
</xsd:annotation>
</xsd:attribute>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="location">
<xsd:annotation>
<xsd:documentation>
Resource location path for the Script. Either this or an inline script
as body text should be provided, but not both.
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="script-variable-generator" type="xsd:string">
<xsd:annotation>
<xsd:documentation>
Reference to the ScriptVariableGenerator bean. This attribute is mutually
exclusive with any 'variable' sub-elements.
</xsd:documentation>
<xsd:appinfo>
<tool:expected-type
type="org.springframework.integration.scripting.ScriptVariableGenerator" />
</xsd:appinfo>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="refresh-check-delay">
<xsd:annotation>
<xsd:documentation>
Refresh delay for the script contents if specified as a resource
location (defaults to -1, never refresh).
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:complexType>
</xsd:schema>

View File

@@ -2,10 +2,10 @@
<beans:beans xmlns="http://www.springframework.org/schema/integration"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:script="http://www.springframework.org/schema/integration/script"
xmlns:script="http://www.springframework.org/schema/integration/scripting"
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/integration/script http://www.springframework.org/schema/integration/script.xsd">
http://www.springframework.org/schema/integration/scripting http://www.springframework.org/schema/integration/scripting/spring-integration-scripting.xsd">
<filter input-channel="referencedScriptInput">
<script:script lang="groovy" location="org/springframework/integration/scripting/config/jsr223/Jsr223FilterTests.groovy"/>

View File

@@ -2,10 +2,10 @@
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:int="http://www.springframework.org/schema/integration"
xmlns:script="http://www.springframework.org/schema/integration/script"
xmlns:script="http://www.springframework.org/schema/integration/scripting"
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/integration/script http://www.springframework.org/schema/integration/script.xsd">
http://www.springframework.org/schema/integration/scripting http://www.springframework.org/schema/integration/scripting/spring-integration-scripting.xsd">
<int:channel id="inputA"/>

View File

@@ -2,10 +2,10 @@
<beans:beans xmlns="http://www.springframework.org/schema/integration"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:script="http://www.springframework.org/schema/integration/script"
xmlns:script="http://www.springframework.org/schema/integration/scripting"
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/integration/script http://www.springframework.org/schema/integration/script.xsd">
http://www.springframework.org/schema/integration/scripting http://www.springframework.org/schema/integration/scripting/spring-integration-scripting.xsd">
<bean class="org.springframework.beans.factory.config.CustomEditorConfigurer" xmlns="http://www.springframework.org/schema/beans">
<property name="customEditors">

View File

@@ -2,10 +2,10 @@
<beans:beans xmlns="http://www.springframework.org/schema/integration"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:int-script="http://www.springframework.org/schema/integration/script"
xmlns:int-script="http://www.springframework.org/schema/integration/scripting"
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/integration/script http://www.springframework.org/schema/integration/script.xsd">
http://www.springframework.org/schema/integration/scripting http://www.springframework.org/schema/integration/scripting/spring-integration-scripting.xsd">
<channel id="shortStrings">
<queue/>

View File

@@ -3,11 +3,11 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:script="http://www.springframework.org/schema/integration/script"
xmlns:script="http://www.springframework.org/schema/integration/scripting"
xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/integration/script http://www.springframework.org/schema/integration/script.xsd">
http://www.springframework.org/schema/integration/scripting http://www.springframework.org/schema/integration/scripting/spring-integration-scripting.xsd">
<service-activator input-channel="referencedScriptInput">
<script:script

View File

@@ -2,10 +2,10 @@
<beans:beans xmlns="http://www.springframework.org/schema/integration"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:script="http://www.springframework.org/schema/integration/script"
xmlns:script="http://www.springframework.org/schema/integration/scripting"
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/integration/script http://www.springframework.org/schema/integration/script.xsd">
http://www.springframework.org/schema/integration/scripting http://www.springframework.org/schema/integration/scripting/spring-integration-scripting.xsd">
<service-activator input-channel="inlineScriptInput">
<script:script lang="ruby">

View File

@@ -2,10 +2,10 @@
<beans:beans xmlns="http://www.springframework.org/schema/integration"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:script="http://www.springframework.org/schema/integration/script"
xmlns:script="http://www.springframework.org/schema/integration/scripting"
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/integration/script http://www.springframework.org/schema/integration/script.xsd">
http://www.springframework.org/schema/integration/scripting http://www.springframework.org/schema/integration/scripting/spring-integration-scripting.xsd">
<service-activator input-channel="withScriptVariableGenerator">
<script:script lang="ruby" location="org/springframework/integration/scripting/config/jsr223/Jsr223ServiceActivatorTests.rb"

View File

@@ -3,10 +3,10 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:jsr223="http://www.springframework.org/schema/integration/jsr223"
xmlns:script="http://www.springframework.org/schema/integration/script"
xmlns:script="http://www.springframework.org/schema/integration/scripting"
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/integration/script http://www.springframework.org/schema/integration/script.xsd
http://www.springframework.org/schema/integration/scripting http://www.springframework.org/schema/integration/scripting/spring-integration-scripting.xsd
http://www.springframework.org/schema/integration/jsr223 http://www.springframework.org/schema/integration/jsr223/spring-integration-jsr223.xsd">
<splitter input-channel="referencedScriptInput">

View File

@@ -2,10 +2,10 @@
<beans:beans xmlns="http://www.springframework.org/schema/integration"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:script="http://www.springframework.org/schema/integration/script"
xmlns:script="http://www.springframework.org/schema/integration/scripting"
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/integration/script http://www.springframework.org/schema/integration/script.xsd">
http://www.springframework.org/schema/integration/scripting http://www.springframework.org/schema/integration/scripting/spring-integration-scripting.xsd">
<transformer input-channel="referencedScriptInput">
<script:script