Class GroovyScriptExecutingMessageProcessor
java.lang.Object
org.springframework.integration.scripting.AbstractScriptExecutingMessageProcessor<Object>
org.springframework.integration.groovy.GroovyScriptExecutingMessageProcessor
- All Implemented Interfaces:
- Aware,- BeanClassLoaderAware,- BeanFactoryAware,- InitializingBean,- MessageProcessor<Object>
public class GroovyScriptExecutingMessageProcessor
extends AbstractScriptExecutingMessageProcessor<Object>
implements InitializingBean
The 
MessageProcessor implementation
 to evaluate Groovy scripts.- Since:
- 2.0
- Author:
- Dave Syer, Mark Fisher, Oleg Zhurakousky, Stefan Reuter, Artem Bilan, Gary Russell
- 
Constructor SummaryConstructorsConstructorDescriptionGroovyScriptExecutingMessageProcessor(ScriptSource scriptSource) Create a processor for the givenScriptSourcethat will use a DefaultScriptVariableGenerator.GroovyScriptExecutingMessageProcessor(ScriptSource scriptSource, ScriptVariableGenerator scriptVariableGenerator) Create a processor for the givenScriptSourcethat will use the provided ScriptVariableGenerator.
- 
Method SummaryModifier and TypeMethodDescriptionvoidprotected ObjectexecuteScript(ScriptSource scriptSource, Map<String, Object> variables) Subclasses must implement this method.protected ScriptSourcegetScriptSource(Message<?> message) Subclasses must implement this method to create a script source, optionally using the message to locate or create the script.voidsetCompilerConfiguration(org.codehaus.groovy.control.CompilerConfiguration compilerConfiguration) Specify theCompilerConfigurationoptions to customize the Groovy script compilation.voidsetCompileStatic(boolean compileStatic) Specify thebooleanflag to indicate if theGroovyClassLoader's compiler should be customised for theCompileStatichint for the provided script.voidsetCustomizer(GroovyObjectCustomizer customizer) Sets aGroovyObjectCustomizerfor this processor.Methods inherited from class org.springframework.integration.scripting.AbstractScriptExecutingMessageProcessorgetBeanClassLoader, getBeanFactory, getScriptVariableGenerator, processMessage, setBeanClassLoader, setBeanFactory
- 
Constructor Details- 
GroovyScriptExecutingMessageProcessorCreate a processor for the givenScriptSourcethat will use a DefaultScriptVariableGenerator.- Parameters:
- scriptSource- The script source.
 
- 
GroovyScriptExecutingMessageProcessorpublic GroovyScriptExecutingMessageProcessor(ScriptSource scriptSource, ScriptVariableGenerator scriptVariableGenerator) Create a processor for the givenScriptSourcethat will use the provided ScriptVariableGenerator.- Parameters:
- scriptSource- The script source.
- scriptVariableGenerator- The variable generator.
 
 
- 
- 
Method Details- 
setCustomizerSets aGroovyObjectCustomizerfor this processor.- Parameters:
- customizer- The customizer.
 
- 
setCompileStaticpublic void setCompileStatic(boolean compileStatic) Specify thebooleanflag to indicate if theGroovyClassLoader's compiler should be customised for theCompileStatichint for the provided script.More compiler options can be provided via setCompilerConfiguration(CompilerConfiguration)overriding this flag.- Parameters:
- compileStatic- the compile-static- booleanflag.
- Since:
- 4.3
- See Also:
 
- 
setCompilerConfigurationpublic void setCompilerConfiguration(org.codehaus.groovy.control.CompilerConfiguration compilerConfiguration) Specify theCompilerConfigurationoptions to customize the Groovy script compilation. For example theCompileStaticandImportCustomizerare the most popular options.- Parameters:
- compilerConfiguration- the Groovy script compiler options to use.
- Since:
- 4.3
- See Also:
 
- 
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
 
- 
afterPropertiesSetpublic void afterPropertiesSet()- Specified by:
- afterPropertiesSetin interface- InitializingBean
 
- 
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.
 
 
-