org.milyn.container.plugin
Class PayloadProcessor

java.lang.Object
  extended by org.milyn.container.plugin.PayloadProcessor

public class PayloadProcessor
extends Object

Processor class for an abstract payload type.

This class can be used to ease Smooks integration with application containers (for example ESBs). It works out how to filter the supplied Object payload through Smooks, to produce the desired result type.

The "payload" object supplied to the process(Object, org.milyn.container.ExecutionContext) method can be one of type:

The SourceResult payload type allows full control over the filter Source and Result.

Author:
Daniel Bevenius

Constructor Summary
PayloadProcessor(Smooks smooks, ResultType resultType)
          Public constructor.
 
Method Summary
 Object process(Object payload, ExecutionContext executionContext)
          Process the supplied payload.
 void setJavaResultBeanId(String javaResultBeanId)
          Set the bean ID to be unpacked from a JavaResult.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PayloadProcessor

public PayloadProcessor(Smooks smooks,
                        ResultType resultType)
Public constructor.

Parameters:
smooks - The Smooks instance to be used.
resultType - The required result type.
Method Detail

setJavaResultBeanId

public void setJavaResultBeanId(String javaResultBeanId)
Set the bean ID to be unpacked from a JavaResult.

Only relevant for ResultType.JAVA. If not specified, the complete result Map will be returned as the result of the process(Object, org.milyn.container.ExecutionContext) method call.

Parameters:
javaResultBeanId - The bean ID to be unpacked.

process

public final Object process(Object payload,
                            ExecutionContext executionContext)
                     throws SmooksException
Process the supplied payload.

See class level javadoc.

Parameters:
payload - The payload to be filtered. See class level javadoc for supported data types.
Returns:
The filter result. Will be "unpacked" as per the ResultType supplied in the constructor.
Throws:
SmooksException


Copyright © 2009. All Rights Reserved.