public class GroovyScriptExecutingMessageProcessor extends AbstractScriptExecutingMessageProcessor<Object>
MessageProcessor implementation
to evaluate Groovy scripts.beanClassLoader, beanFactory| Constructor and Description |
|---|
GroovyScriptExecutingMessageProcessor(ScriptSource scriptSource)
Create a processor for the given
ScriptSource that will use a
DefaultScriptVariableGenerator. |
GroovyScriptExecutingMessageProcessor(ScriptSource scriptSource,
ScriptVariableGenerator scriptVariableGenerator)
Create a processor for the given
ScriptSource 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 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 |
setBeanClassLoader(ClassLoader classLoader) |
void |
setBeanFactory(BeanFactory beanFactory) |
void |
setCustomizer(GroovyObjectCustomizer customizer)
Sets a
GroovyObjectCustomizer for this processor. |
processMessagepublic GroovyScriptExecutingMessageProcessor(ScriptSource scriptSource)
ScriptSource that will use a
DefaultScriptVariableGenerator.scriptSource - The script source.public GroovyScriptExecutingMessageProcessor(ScriptSource scriptSource, ScriptVariableGenerator scriptVariableGenerator)
ScriptSource that will use the provided
ScriptVariableGenerator.scriptSource - The script source.scriptVariableGenerator - The variable generator.public void setBeanClassLoader(ClassLoader classLoader)
setBeanClassLoader in interface BeanClassLoaderAwaresetBeanClassLoader in class AbstractScriptExecutingMessageProcessor<Object>public void setBeanFactory(BeanFactory beanFactory) throws BeansException
setBeanFactory in interface BeanFactoryAwaresetBeanFactory in class AbstractScriptExecutingMessageProcessor<Object>BeansExceptionpublic void setCustomizer(GroovyObjectCustomizer customizer)
GroovyObjectCustomizer for this processor.customizer - The customizer.protected ScriptSource getScriptSource(Message<?> message)
AbstractScriptExecutingMessageProcessorgetScriptSource in class AbstractScriptExecutingMessageProcessor<Object>message - the message being processedprotected Object executeScript(ScriptSource scriptSource, Map<String,Object> variables) throws Exception
AbstractScriptExecutingMessageProcessorexecuteScript in class AbstractScriptExecutingMessageProcessor<Object>scriptSource - The script source.variables - The variables.Exception - Any Exception.