Spring Integration

org.springframework.integration.handler
Class AbstractScriptExecutingMessageProcessor<T>

java.lang.Object
  extended by org.springframework.integration.handler.AbstractScriptExecutingMessageProcessor<T>
All Implemented Interfaces:
MessageProcessor<T>
Direct Known Subclasses:
GroovyScriptExecutingMessageProcessor

public abstract class AbstractScriptExecutingMessageProcessor<T>
extends Object
implements MessageProcessor<T>

Base MessageProcessor for scripting implementations to extend.

Since:
2.0
Author:
Mark Fisher

Constructor Summary
AbstractScriptExecutingMessageProcessor(ScriptSource scriptSource)
          Create a processor for the given ScriptSource.
 
Method Summary
protected abstract  T executeScript(ScriptSource scriptSource, Message<?> message)
          Subclasses must implement this method.
 T processMessage(Message<?> message)
          Executes the script and returns the result.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractScriptExecutingMessageProcessor

public AbstractScriptExecutingMessageProcessor(ScriptSource scriptSource)
Create a processor for the given ScriptSource.

Method Detail

processMessage

public final T processMessage(Message<?> message)
Executes the script and returns the result.

Specified by:
processMessage in interface MessageProcessor<T>

executeScript

protected abstract T executeScript(ScriptSource scriptSource,
                                   Message<?> message)
                            throws Exception
Subclasses must implement this method. In doing so, the execution context for the script should be populated with the Message's 'payload' and 'headers' as variables.

Throws:
Exception

Spring Integration

Copyright © 2010. All Rights Reserved.