INT-1727 added Message as input parameter to ScriptVariableSource.resolveScriptVariables(Message) method
This commit is contained in:
@@ -64,7 +64,7 @@ public class GroovyScriptExecutingMessageProcessor extends AbstractScriptExecuti
|
||||
synchronized (this) {
|
||||
this.customizer.setMessage(message);
|
||||
if (this.scriptVariableSource != null){
|
||||
this.customizer.setResolvedScriptVariables(this.scriptVariableSource.resolveScriptVariables());
|
||||
this.customizer.setResolvedScriptVariables(this.scriptVariableSource.resolveScriptVariables(message));
|
||||
}
|
||||
Object result = this.scriptFactory.getScriptedObject(scriptSource, null);
|
||||
return (result instanceof GString) ? result.toString() : result;
|
||||
|
||||
@@ -17,6 +17,8 @@ package org.springframework.integration.groovy;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.integration.Message;
|
||||
|
||||
|
||||
/**
|
||||
* @author Oleg Zhurakousky
|
||||
@@ -24,5 +26,5 @@ import java.util.Map;
|
||||
*/
|
||||
public interface ScriptVariableSource {
|
||||
|
||||
Map<String, Object> resolveScriptVariables();
|
||||
Map<String, Object> resolveScriptVariables(Message<?> message);
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ public class GroovyScriptExecutingMessageProcessorTests {
|
||||
Object result = null;
|
||||
for (int i = 0; i < 5; i++) {
|
||||
ScriptVariableSource scriptVariableSource = new ScriptVariableSource() {
|
||||
public Map<String, Object> resolveScriptVariables() {
|
||||
public Map<String, Object> resolveScriptVariables(Message<?> message) {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("date", System.nanoTime());
|
||||
return map;
|
||||
|
||||
Reference in New Issue
Block a user