Class AbstractScriptExecutingMessageProcessor<T>
java.lang.Object
org.springframework.integration.scripting.AbstractScriptExecutingMessageProcessor<T>
- Type Parameters:
- T- the paylaod type.
- All Implemented Interfaces:
- Aware,- BeanClassLoaderAware,- BeanFactoryAware,- MessageProcessor<T>
- Direct Known Subclasses:
- GroovyScriptExecutingMessageProcessor,- ScriptExecutingMessageProcessor
public abstract class AbstractScriptExecutingMessageProcessor<T>
extends Object
implements MessageProcessor<T>, BeanClassLoaderAware, BeanFactoryAware
Base 
MessageProcessor for scripting implementations to extend.- Since:
- 2.0
- Author:
- Mark Fisher, Stefan Reuter, Artem Bilan
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedprotectedAbstractScriptExecutingMessageProcessor(ScriptVariableGenerator scriptVariableGenerator) 
- 
Method SummaryModifier and TypeMethodDescriptionprotected abstract TexecuteScript(ScriptSource scriptSource, Map<String, Object> variables) Subclasses must implement this method.protected ClassLoaderprotected BeanFactoryprotected abstract ScriptSourcegetScriptSource(Message<?> message) Subclasses must implement this method to create a script source, optionally using the message to locate or create the script.protected ScriptVariableGeneratorfinal TprocessMessage(Message<?> message) Execute the script and return the result.voidsetBeanClassLoader(ClassLoader classLoader) voidsetBeanFactory(BeanFactory beanFactory) 
- 
Constructor Details- 
AbstractScriptExecutingMessageProcessorprotected AbstractScriptExecutingMessageProcessor()
- 
AbstractScriptExecutingMessageProcessor
 
- 
- 
Method Details- 
setBeanClassLoader- Specified by:
- setBeanClassLoaderin interface- BeanClassLoaderAware
 
- 
setBeanFactory- Specified by:
- setBeanFactoryin interface- BeanFactoryAware
- Throws:
- BeansException
 
- 
getScriptVariableGenerator
- 
getBeanClassLoader
- 
getBeanFactory
- 
processMessageExecute the script and return the result.- Specified by:
- processMessagein interface- MessageProcessor<T>
- Parameters:
- message- The message to process.
- Returns:
- The result.
 
- 
getScriptSourceSubclasses must implement this method to create a script source, optionally using the message to locate or create the script.- Parameters:
- message- the message being processed
- Returns:
- a ScriptSource to use to create a script
 
- 
executeScript@Nullable protected abstract T executeScript(ScriptSource scriptSource, Map<String, Object> variables) Subclasses must implement this method. In doing so, the execution context for the script should be populated with the provided script variables.- Parameters:
- scriptSource- The script source.
- variables- The variables.
- Returns:
- The result of the execution.
 
 
-