net.sf.xbus.protocol.java
Class JavaTransformer

java.lang.Object
  extended by net.sf.xbus.protocol.java.JavaTransformer
All Implemented Interfaces:
Transformer

public class JavaTransformer
extends java.lang.Object
implements Transformer

The JavaTransformer calls a method of a Java class, to transform the source into the destination format. Which class and which method to be used is read out of the configuration.

The signature of the called method must be:

     public Object <i>methodName</i>(Object inObject) throws XException
 


Constructor Summary
JavaTransformer()
           
 
Method Summary
 java.lang.Object transform(java.lang.Object inObject, XBUSSystem source, XBUSSystem destination, Message destinationMessage)
          The transform method is automatically called by the xBus during the routing of messages.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaTransformer

public JavaTransformer()
Method Detail

transform

public java.lang.Object transform(java.lang.Object inObject,
                                  XBUSSystem source,
                                  XBUSSystem destination,
                                  Message destinationMessage)
                           throws XException
Description copied from interface: Transformer
The transform method is automatically called by the xBus during the routing of messages.

Specified by:
transform in interface Transformer
Parameters:
inObject - either the request or response that shall be transformed to another format
source - the XBUSSystem of the message of the inObject
destination - the XBUSSystem of the target message
destinationMessage - the target message eventually contains more information necessary for transforming
Returns:
the transformed Object, written to either the request or response of the target message
Throws:
XException