public class GroovyScriptExecutingMessageProcessor extends AbstractScriptExecutingMessageProcessor<java.lang.Object>
MessageProcessor
implementation
to evaluate Groovy scripts.beanClassLoader, beanFactory
Constructor and Description |
---|
GroovyScriptExecutingMessageProcessor(org.springframework.scripting.ScriptSource scriptSource)
Create a processor for the given
ScriptSource that will use a
DefaultScriptVariableGenerator. |
GroovyScriptExecutingMessageProcessor(org.springframework.scripting.ScriptSource scriptSource,
ScriptVariableGenerator scriptVariableGenerator)
Create a processor for the given
ScriptSource that will use the provided
ScriptVariableGenerator. |
Modifier and Type | Method and Description |
---|---|
protected java.lang.Object |
executeScript(org.springframework.scripting.ScriptSource scriptSource,
java.util.Map<java.lang.String,java.lang.Object> variables)
Subclasses must implement this method.
|
protected org.springframework.scripting.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(java.lang.ClassLoader classLoader) |
void |
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) |
void |
setCustomizer(org.springframework.scripting.groovy.GroovyObjectCustomizer customizer)
Sets a
GroovyObjectCustomizer for this processor. |
processMessage
public GroovyScriptExecutingMessageProcessor(org.springframework.scripting.ScriptSource scriptSource)
ScriptSource
that will use a
DefaultScriptVariableGenerator.public GroovyScriptExecutingMessageProcessor(org.springframework.scripting.ScriptSource scriptSource, ScriptVariableGenerator scriptVariableGenerator)
ScriptSource
that will use the provided
ScriptVariableGenerator.public void setBeanClassLoader(java.lang.ClassLoader classLoader)
setBeanClassLoader
in interface org.springframework.beans.factory.BeanClassLoaderAware
setBeanClassLoader
in class AbstractScriptExecutingMessageProcessor<java.lang.Object>
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) throws org.springframework.beans.BeansException
setBeanFactory
in interface org.springframework.beans.factory.BeanFactoryAware
setBeanFactory
in class AbstractScriptExecutingMessageProcessor<java.lang.Object>
org.springframework.beans.BeansException
public void setCustomizer(org.springframework.scripting.groovy.GroovyObjectCustomizer customizer)
GroovyObjectCustomizer
for this processor.protected org.springframework.scripting.ScriptSource getScriptSource(Message<?> message)
AbstractScriptExecutingMessageProcessor
getScriptSource
in class AbstractScriptExecutingMessageProcessor<java.lang.Object>
message
- the message being processedprotected java.lang.Object executeScript(org.springframework.scripting.ScriptSource scriptSource, java.util.Map<java.lang.String,java.lang.Object> variables) throws java.lang.Exception
AbstractScriptExecutingMessageProcessor
executeScript
in class AbstractScriptExecutingMessageProcessor<java.lang.Object>
java.lang.Exception