org.apache.tuscany.sca.core.databinding.transformers
Class Exception2ExceptionTransformer

java.lang.Object
  extended by org.apache.tuscany.sca.databinding.impl.BaseTransformer<java.lang.Throwable,java.lang.Throwable>
      extended by org.apache.tuscany.sca.core.databinding.transformers.Exception2ExceptionTransformer
All Implemented Interfaces:
PullTransformer<java.lang.Throwable,java.lang.Throwable>, Transformer

public class Exception2ExceptionTransformer
extends BaseTransformer<java.lang.Throwable,java.lang.Throwable>
implements PullTransformer<java.lang.Throwable,java.lang.Throwable>

This is a special transformer to transform the exception from one IDL to the other one


Field Summary
protected  FaultExceptionMapper faultExceptionMapper
           
protected  Mediator mediator
           
 
Constructor Summary
Exception2ExceptionTransformer()
           
Exception2ExceptionTransformer(Mediator mediator, FaultExceptionMapper faultExceptionMapper)
           
 
Method Summary
 java.lang.String getSourceDataBinding()
          Get the source type that this transformer transforms data from.
protected  java.lang.Class<java.lang.Throwable> getSourceType()
           
 java.lang.String getTargetDataBinding()
          Get the target type that this transformer transforms data into.
protected  java.lang.Class<java.lang.Throwable> getTargetType()
           
 int getWeight()
          Get the cost of the transformation.
 void setFaultExceptionMapper(FaultExceptionMapper faultExceptionMapper)
           
 void setMediator(Mediator mediator)
           
 java.lang.Throwable transform(java.lang.Throwable source, TransformationContext context)
          Transform source data into the result type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mediator

protected Mediator mediator

faultExceptionMapper

protected FaultExceptionMapper faultExceptionMapper
Constructor Detail

Exception2ExceptionTransformer

public Exception2ExceptionTransformer(Mediator mediator,
                                      FaultExceptionMapper faultExceptionMapper)

Exception2ExceptionTransformer

public Exception2ExceptionTransformer()
Method Detail

getSourceDataBinding

public java.lang.String getSourceDataBinding()
Description copied from interface: Transformer
Get the source type that this transformer transforms data from. The type is used as the key when the transformer is registered with TransformerRegistry.

Specified by:
getSourceDataBinding in interface Transformer
Overrides:
getSourceDataBinding in class BaseTransformer<java.lang.Throwable,java.lang.Throwable>
Returns:
A key identifying the source type

getTargetDataBinding

public java.lang.String getTargetDataBinding()
Description copied from interface: Transformer
Get the target type that this transformer transforms data into. The type is used as the key when the transformer is registered with TransformerRegistry.

Specified by:
getTargetDataBinding in interface Transformer
Overrides:
getTargetDataBinding in class BaseTransformer<java.lang.Throwable,java.lang.Throwable>
Returns:
A key identifying the target type

setMediator

public void setMediator(Mediator mediator)
Parameters:
mediator - the mediator to set

getSourceType

protected java.lang.Class<java.lang.Throwable> getSourceType()
Specified by:
getSourceType in class BaseTransformer<java.lang.Throwable,java.lang.Throwable>
See Also:
BaseTransformer.getSourceType()

getTargetType

protected java.lang.Class<java.lang.Throwable> getTargetType()
Specified by:
getTargetType in class BaseTransformer<java.lang.Throwable,java.lang.Throwable>
See Also:
BaseTransformer.getTargetType()

getWeight

public int getWeight()
Description copied from interface: Transformer
Get the cost of the transformation. The weight can be used to choose the most efficient path if there are more than one available from the source to the target.

Specified by:
getWeight in interface Transformer
Overrides:
getWeight in class BaseTransformer<java.lang.Throwable,java.lang.Throwable>
Returns:
An integer representing the cost of the transformation
See Also:
Transformer.getWeight()

transform

public java.lang.Throwable transform(java.lang.Throwable source,
                                     TransformationContext context)
Description copied from interface: PullTransformer
Transform source data into the result type.

Specified by:
transform in interface PullTransformer<java.lang.Throwable,java.lang.Throwable>
Parameters:
source - The source data
context - The context for the transformation
Returns:
The transformed result

setFaultExceptionMapper

public void setFaultExceptionMapper(FaultExceptionMapper faultExceptionMapper)