org.springframework.integration.groovy
Class GroovyScriptExecutingMessageProcessor

java.lang.Object
  extended by org.springframework.integration.handler.AbstractScriptExecutingMessageProcessor<java.lang.Object>
      extended by org.springframework.integration.groovy.GroovyScriptExecutingMessageProcessor
All Implemented Interfaces:
MessageProcessor<java.lang.Object>

public class GroovyScriptExecutingMessageProcessor
extends AbstractScriptExecutingMessageProcessor<java.lang.Object>

Since:
2.0

Constructor Summary
GroovyScriptExecutingMessageProcessor(ScriptSource scriptSource)
          Create a processor for the given ScriptSource.
 
Method Summary
protected  java.lang.Object executeScript(ScriptSource scriptSource, Message<?> message)
          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.
 
Methods inherited from class org.springframework.integration.handler.AbstractScriptExecutingMessageProcessor
processMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroovyScriptExecutingMessageProcessor

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

Method Detail

getScriptSource

protected ScriptSource getScriptSource(Message<?> message)
Description copied from class: AbstractScriptExecutingMessageProcessor
Subclasses must implement this method to create a script source, optionally using the message to locate or create the script.

Specified by:
getScriptSource in class AbstractScriptExecutingMessageProcessor<java.lang.Object>
Parameters:
message - the message being processed
Returns:
a ScriptSource to use to create a script

executeScript

protected java.lang.Object executeScript(ScriptSource scriptSource,
                                         Message<?> message)
                                  throws java.lang.Exception
Description copied from class: AbstractScriptExecutingMessageProcessor
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.

Specified by:
executeScript in class AbstractScriptExecutingMessageProcessor<java.lang.Object>
Throws:
java.lang.Exception