SwitchYard: Core 0.6.0.Beta2

org.switchyard.transform
Class TransformSequence

java.lang.Object
  extended by org.switchyard.transform.TransformSequence
All Implemented Interfaces:
Serializable

public final class TransformSequence
extends Object
implements Serializable

Transformation sequence/pipeline.

Allows the stringing together of a sequence of transformers and then associating that with a Message context e.g.

 TransformSequence.from("a").to("b").to("c').associateWith(messageContext);
 

Author:
tom.fennelly@gmail.com
See Also:
Serialized Form

Method Summary
 void apply(Message message, TransformerRegistry registry)
          Apply this TransformSequence to the supplied Message instance.
static void applySequence(Exchange exchange, TransformerRegistry registry)
          Apply the active exchange transformation sequence to the supplied Exchange Message.
static boolean assertTransformsApplied(Exchange exchange)
          Utility assertion method for checking if the source to destination transformations have been applied to the Exchange.
 void associateWith(Exchange exchange, Scope scope)
          Associate this instance with the supplied message context.
static TransformSequence from(QName typeName)
          Start the transformation sequence.
static QName getCurrentMessageType(Exchange exchange)
          Get the current message type for the specified exchange.
static QName getTargetMessageType(Exchange exchange)
          Get the target message type for the specified exchange phase.
 TransformSequence to(QName typeName)
          Add to the transformation sequence.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

associateWith

public void associateWith(Exchange exchange,
                          Scope scope)
Associate this instance with the supplied message context.

Parameters:
exchange - associate the transform to this exchange
scope - associate the transform with this scope

from

public static TransformSequence from(QName typeName)
Start the transformation sequence.

Parameters:
typeName - The from type.
Returns:
The sequence.

to

public TransformSequence to(QName typeName)
Add to the transformation sequence.

Parameters:
typeName - The from type.
Returns:
The sequence.

apply

public void apply(Message message,
                  TransformerRegistry registry)
Apply this TransformSequence to the supplied Message instance.

Parameters:
message - Message instance.
registry - Transformation Registry.

getCurrentMessageType

public static QName getCurrentMessageType(Exchange exchange)
Get the current message type for the specified exchange.

Parameters:
exchange - The exchange.
Returns:
The current exchange message type, or null if no TransformSequence is set on the exchange.

getTargetMessageType

public static QName getTargetMessageType(Exchange exchange)
Get the target message type for the specified exchange phase.

Parameters:
exchange - The exchange.
Returns:
The target exchange message type, or null if no TransformSequence is set on the exchange.

assertTransformsApplied

public static boolean assertTransformsApplied(Exchange exchange)
Utility assertion method for checking if the source to destination transformations have been applied to the Exchange.

Parameters:
exchange - The exchange instance.
Returns:
True if the transformations have been applied (or are not specified), otherwise false.

applySequence

public static void applySequence(Exchange exchange,
                                 TransformerRegistry registry)
Apply the active exchange transformation sequence to the supplied Exchange Message.

Parameters:
exchange - The Exchange instance.
registry - The transformation registry.

SwitchYard: Core 0.6.0.Beta2

JBoss by Red Hat