Class GroovyCommandMessageProcessor
java.lang.Object
org.springframework.integration.scripting.AbstractScriptExecutingMessageProcessor<Object>
org.springframework.integration.groovy.GroovyCommandMessageProcessor
- All Implemented Interfaces:
- Aware,- BeanClassLoaderAware,- BeanFactoryAware,- MessageProcessor<Object>,- IntegrationPattern
public class GroovyCommandMessageProcessor
extends AbstractScriptExecutingMessageProcessor<Object>
implements IntegrationPattern
- Since:
- 2.0
- Author:
- Dave Syer, Mark Fisher, Oleg Zhurakousky, Artem Bilan, Stefan Reuter, Gary Russell
- 
Constructor SummaryConstructorsConstructorDescriptionCreates aGroovyCommandMessageProcessorthat will use theDefaultScriptVariableGenerator.GroovyCommandMessageProcessor(groovy.lang.Binding binding) Creates aGroovyCommandMessageProcessorthat will use theDefaultScriptVariableGeneratorand providedBinding.GroovyCommandMessageProcessor(groovy.lang.Binding binding, ScriptVariableGenerator scriptVariableGenerator) Creates aGroovyCommandMessageProcessorthat will use the providedScriptVariableGeneratorand Binding.GroovyCommandMessageProcessor(ScriptVariableGenerator scriptVariableGenerator) Creates aGroovyCommandMessageProcessorthat will use the providedScriptVariableGenerator.
- 
Method SummaryModifier and TypeMethodDescriptionprotected ObjectexecuteScript(ScriptSource scriptSource, Map<String, Object> variables) Subclasses must implement this method.protected StringgenerateScriptName(Message<?> message) Return a pattern type this component implements.protected ScriptSourcegetScriptSource(Message<?> message) Subclasses must implement this method to create a script source, optionally using the message to locate or create the script.voidsetCustomizer(GroovyObjectCustomizer customizer) Sets aGroovyObjectCustomizerfor this processor.Methods inherited from class org.springframework.integration.scripting.AbstractScriptExecutingMessageProcessorgetBeanClassLoader, getBeanFactory, getScriptVariableGenerator, processMessage, setBeanClassLoader, setBeanFactory
- 
Constructor Details- 
GroovyCommandMessageProcessorpublic GroovyCommandMessageProcessor()Creates aGroovyCommandMessageProcessorthat will use theDefaultScriptVariableGenerator.
- 
GroovyCommandMessageProcessorCreates aGroovyCommandMessageProcessorthat will use the providedScriptVariableGenerator.- Parameters:
- scriptVariableGenerator- The variable generator.
 
- 
GroovyCommandMessageProcessorpublic 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.
 
- 
GroovyCommandMessageProcessorpublic GroovyCommandMessageProcessor(groovy.lang.Binding binding, 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- 
setCustomizerSets aGroovyObjectCustomizerfor this processor.- Parameters:
- customizer- The customizer.
 
- 
getIntegrationPatternTypeDescription copied from interface:IntegrationPatternReturn a pattern type this component implements.- Specified by:
- getIntegrationPatternTypein interface- IntegrationPattern
- Returns:
- the IntegrationPatternTypethis component implements.
 
- 
getScriptSourceDescription copied from class:AbstractScriptExecutingMessageProcessorSubclasses must implement this method to create a script source, optionally using the message to locate or create the script.- Specified by:
- getScriptSourcein class- AbstractScriptExecutingMessageProcessor<Object>
- Parameters:
- message- the message being processed
- Returns:
- a ScriptSource to use to create a script
 
- 
executeScriptDescription copied from class:AbstractScriptExecutingMessageProcessorSubclasses must implement this method. In doing so, the execution context for the script should be populated with the provided script variables.- Specified by:
- executeScriptin class- AbstractScriptExecutingMessageProcessor<Object>
- Parameters:
- scriptSource- The script source.
- variables- The variables.
- Returns:
- The result of the execution.
 
- 
generateScriptName
 
-