Spring Integration

org.springframework.integration.handler
Class AbstractScriptExecutingMessageProcessor

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

public abstract class AbstractScriptExecutingMessageProcessor
extends Object
implements MessageProcessor

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  Object executeScript(ScriptSource scriptSource, Message<?> message)
          Subclasses must implement this method.
 Object 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 Object processMessage(Message<?> message)
Executes the script and returns the result.

Specified by:
processMessage in interface MessageProcessor

executeScript

protected abstract Object 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.