public class GroovyCommandMessageProcessor extends AbstractScriptExecutingMessageProcessor<Object>
beanClassLoader, beanFactory
Constructor and Description |
---|
GroovyCommandMessageProcessor()
Creates a
GroovyCommandMessageProcessor that will use the DefaultScriptVariableGenerator . |
GroovyCommandMessageProcessor(groovy.lang.Binding binding)
Creates a
GroovyCommandMessageProcessor that will use the DefaultScriptVariableGenerator
and provided Binding . |
GroovyCommandMessageProcessor(groovy.lang.Binding binding,
ScriptVariableGenerator scriptVariableGenerator)
Creates a
GroovyCommandMessageProcessor that will use the provided ScriptVariableGenerator and Binding. |
GroovyCommandMessageProcessor(ScriptVariableGenerator scriptVariableGenerator)
Creates a
GroovyCommandMessageProcessor that will use the provided ScriptVariableGenerator . |
Modifier and Type | Method and Description |
---|---|
protected Object |
executeScript(ScriptSource scriptSource,
Map<String,Object> variables)
Subclasses must implement this method.
|
protected String |
generateScriptName(Message<?> message) |
protected ScriptSource |
getScriptSource(Message<?> message)
Subclasses must implement this method to create a script source,
optionally using the message to locate or create the script.
|
void |
setCustomizer(GroovyObjectCustomizer customizer)
Sets a
GroovyObjectCustomizer for this processor. |
processMessage, setBeanClassLoader, setBeanFactory
public GroovyCommandMessageProcessor()
GroovyCommandMessageProcessor
that will use the DefaultScriptVariableGenerator
.public GroovyCommandMessageProcessor(ScriptVariableGenerator scriptVariableGenerator)
GroovyCommandMessageProcessor
that will use the provided ScriptVariableGenerator
.scriptVariableGenerator
- The variable generator.public GroovyCommandMessageProcessor(groovy.lang.Binding binding)
GroovyCommandMessageProcessor
that will use the DefaultScriptVariableGenerator
and provided Binding
.
Provided 'binding' will be used in the BindingOverwriteGroovyObjectCustomizerDecorator
to overwrite
original Groovy Script 'binding'.binding
- The binding.public GroovyCommandMessageProcessor(groovy.lang.Binding binding, ScriptVariableGenerator scriptVariableGenerator)
GroovyCommandMessageProcessor
that will use the provided ScriptVariableGenerator
and Binding.
Provided 'binding' will be used in the BindingOverwriteGroovyObjectCustomizerDecorator
to overwrite
original Groovy Script 'binding'.binding
- The binding.scriptVariableGenerator
- The variable generator.public void setCustomizer(GroovyObjectCustomizer customizer)
GroovyObjectCustomizer
for this processor.customizer
- The customizer.protected ScriptSource getScriptSource(Message<?> message)
AbstractScriptExecutingMessageProcessor
getScriptSource
in class AbstractScriptExecutingMessageProcessor<Object>
message
- the message being processedprotected Object executeScript(ScriptSource scriptSource, Map<String,Object> variables) throws Exception
AbstractScriptExecutingMessageProcessor
executeScript
in class AbstractScriptExecutingMessageProcessor<Object>
scriptSource
- The script source.variables
- The variables.Exception
- Any Exception.