public abstract class AbstractScriptExecutingMessageProcessor<T> extends java.lang.Object implements MessageProcessor<T>, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware
MessageProcessor
for scripting implementations to extend.Modifier and Type | Field and Description |
---|---|
protected java.lang.ClassLoader |
beanClassLoader |
protected org.springframework.beans.factory.BeanFactory |
beanFactory |
Modifier | Constructor and Description |
---|---|
protected |
AbstractScriptExecutingMessageProcessor() |
protected |
AbstractScriptExecutingMessageProcessor(ScriptVariableGenerator scriptVariableGenerator) |
Modifier and Type | Method and Description |
---|---|
protected abstract T |
executeScript(org.springframework.scripting.ScriptSource scriptSource,
java.util.Map<java.lang.String,java.lang.Object> variables)
Subclasses must implement this method.
|
protected abstract 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.
|
T |
processMessage(Message<?> message)
Executes the script and returns the result.
|
void |
setBeanClassLoader(java.lang.ClassLoader classLoader) |
void |
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) |
protected volatile java.lang.ClassLoader beanClassLoader
protected volatile org.springframework.beans.factory.BeanFactory beanFactory
protected AbstractScriptExecutingMessageProcessor()
protected AbstractScriptExecutingMessageProcessor(ScriptVariableGenerator scriptVariableGenerator)
public final T processMessage(Message<?> message)
processMessage
in interface MessageProcessor<T>
public void setBeanClassLoader(java.lang.ClassLoader classLoader)
setBeanClassLoader
in interface org.springframework.beans.factory.BeanClassLoaderAware
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) throws org.springframework.beans.BeansException
setBeanFactory
in interface org.springframework.beans.factory.BeanFactoryAware
org.springframework.beans.BeansException
protected abstract org.springframework.scripting.ScriptSource getScriptSource(Message<?> message)
message
- the message being processedprotected abstract T executeScript(org.springframework.scripting.ScriptSource scriptSource, java.util.Map<java.lang.String,java.lang.Object> variables) throws java.lang.Exception
java.lang.Exception