Class GroovyCommandMessageProcessor
java.lang.Object
org.springframework.integration.scripting.AbstractScriptExecutingMessageProcessor<java.lang.Object>
org.springframework.integration.groovy.GroovyCommandMessageProcessor
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanClassLoaderAware,org.springframework.beans.factory.BeanFactoryAware,org.springframework.integration.handler.MessageProcessor<java.lang.Object>,org.springframework.integration.IntegrationPattern
public class GroovyCommandMessageProcessor
extends org.springframework.integration.scripting.AbstractScriptExecutingMessageProcessor<java.lang.Object>
implements org.springframework.integration.IntegrationPattern
- Since:
- 2.0
-
Constructor Summary
Constructors Constructor Description GroovyCommandMessageProcessor()Creates aGroovyCommandMessageProcessorthat will use theDefaultScriptVariableGenerator.GroovyCommandMessageProcessor(groovy.lang.Binding binding)Creates aGroovyCommandMessageProcessorthat will use theDefaultScriptVariableGeneratorand providedBinding.GroovyCommandMessageProcessor(groovy.lang.Binding binding, org.springframework.integration.scripting.ScriptVariableGenerator scriptVariableGenerator)Creates aGroovyCommandMessageProcessorthat will use the providedScriptVariableGeneratorand Binding.GroovyCommandMessageProcessor(org.springframework.integration.scripting.ScriptVariableGenerator scriptVariableGenerator)Creates aGroovyCommandMessageProcessorthat will use the providedScriptVariableGenerator. -
Method Summary
Modifier and Type Method Description protected java.lang.ObjectexecuteScript(org.springframework.scripting.ScriptSource scriptSource, java.util.Map<java.lang.String,java.lang.Object> variables)protected java.lang.StringgenerateScriptName(org.springframework.messaging.Message<?> message)org.springframework.integration.IntegrationPatternTypegetIntegrationPatternType()protected org.springframework.scripting.ScriptSourcegetScriptSource(org.springframework.messaging.Message<?> message)voidsetCustomizer(org.springframework.scripting.groovy.GroovyObjectCustomizer customizer)Sets aGroovyObjectCustomizerfor this processor.
-
Constructor Details
-
GroovyCommandMessageProcessor
public GroovyCommandMessageProcessor()Creates aGroovyCommandMessageProcessorthat will use theDefaultScriptVariableGenerator. -
GroovyCommandMessageProcessor
public GroovyCommandMessageProcessor(org.springframework.integration.scripting.ScriptVariableGenerator scriptVariableGenerator)Creates aGroovyCommandMessageProcessorthat will use the providedScriptVariableGenerator.- Parameters:
scriptVariableGenerator- The variable generator.
-
GroovyCommandMessageProcessor
public GroovyCommandMessageProcessor(groovy.lang.Binding binding)Creates aGroovyCommandMessageProcessorthat will use theDefaultScriptVariableGeneratorand providedBinding. Provided 'binding' will be used in theBindingOverwriteGroovyObjectCustomizerDecoratorto overwrite original Groovy Script 'binding'.- Parameters:
binding- The binding.
-
GroovyCommandMessageProcessor
public GroovyCommandMessageProcessor(groovy.lang.Binding binding, org.springframework.integration.scripting.ScriptVariableGenerator scriptVariableGenerator)Creates aGroovyCommandMessageProcessorthat will use the providedScriptVariableGeneratorand Binding. Provided 'binding' will be used in theBindingOverwriteGroovyObjectCustomizerDecoratorto overwrite original Groovy Script 'binding'.- Parameters:
binding- The binding.scriptVariableGenerator- The variable generator.
-
-
Method Details
-
setCustomizer
public void setCustomizer(org.springframework.scripting.groovy.GroovyObjectCustomizer customizer)Sets aGroovyObjectCustomizerfor this processor.- Parameters:
customizer- The customizer.
-
getIntegrationPatternType
public org.springframework.integration.IntegrationPatternType getIntegrationPatternType()- Specified by:
getIntegrationPatternTypein interfaceorg.springframework.integration.IntegrationPattern
-
getScriptSource
protected org.springframework.scripting.ScriptSource getScriptSource(org.springframework.messaging.Message<?> message)- Specified by:
getScriptSourcein classorg.springframework.integration.scripting.AbstractScriptExecutingMessageProcessor<java.lang.Object>
-
executeScript
protected java.lang.Object executeScript(org.springframework.scripting.ScriptSource scriptSource, java.util.Map<java.lang.String,java.lang.Object> variables)- Specified by:
executeScriptin classorg.springframework.integration.scripting.AbstractScriptExecutingMessageProcessor<java.lang.Object>
-
generateScriptName
protected java.lang.String generateScriptName(org.springframework.messaging.Message<?> message)
-