org.mule.providers.streaming
Class AbstractStreamingTransformer

java.lang.Object
  extended by org.mule.providers.streaming.AbstractStreamingTransformer
All Implemented Interfaces:
Cloneable, Initialisable, UMOBaseTransformer, UMOStreamingTransformer

public abstract class AbstractStreamingTransformer
extends Object
implements UMOStreamingTransformer

TODO


Field Summary
protected  UMOImmutableEndpoint endpoint
          The endpoint that this transformer instance is configured on
protected  Log logger
          logger used by this class
protected  String name
          The name that identifies this transformer.
protected  UMOStreamingTransformer nextTransformer
          This is the following transformer in the chain of transformers.
 
Constructor Summary
AbstractStreamingTransformer()
          default constructor required for discovery
 
Method Summary
 Object clone()
           
protected abstract  Object doTransform(InputStream src, OutputStream dest, String encoding)
           
protected  String generateTransformerName()
           
 UMOImmutableEndpoint getEndpoint()
          The endpoint that this transformer is attached to
 String getName()
           
 UMOStreamingTransformer getNextTransformer()
          Transformers can be chained together and invoked in a series
 void initialise()
          Template method were deriving classes can do any initialisation after the properties have been set on this transformer
 boolean isAcceptNull()
           
 boolean isIgnoreBadInput()
           
 void setEndpoint(UMOImmutableEndpoint endpoint)
          Sets the endpoint associated with with this connector
 void setIgnoreBadInput(boolean ignoreBadInput)
           
 void setName(String string)
           
 void setNextTransformer(UMOStreamingTransformer nextTransformer)
          Transformers can be chained together and invoked in a series
 String toString()
           
 Object transform(InputStream src, OutputStream dest, String encoding)
          Transforms the object.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

protected final Log logger
logger used by this class


name

protected String name
The name that identifies this transformer. If none is set the class name of the transformer is used


endpoint

protected UMOImmutableEndpoint endpoint
The endpoint that this transformer instance is configured on


nextTransformer

protected UMOStreamingTransformer nextTransformer
This is the following transformer in the chain of transformers.

Constructor Detail

AbstractStreamingTransformer

public AbstractStreamingTransformer()
default constructor required for discovery

Method Detail

getName

public String getName()
Specified by:
getName in interface UMOBaseTransformer
Returns:
transformer name

setName

public void setName(String string)
Specified by:
setName in interface UMOBaseTransformer
Parameters:
string -

transform

public final Object transform(InputStream src,
                              OutputStream dest,
                              String encoding)
                       throws TransformerException
Transforms the object.

Specified by:
transform in interface UMOStreamingTransformer
Parameters:
src - The source object to transform.
encoding - the encoding to use in this transformation (if necessary)
Returns:
The transformed object
Throws:
TransformerException - if a error occurs transforming the data or if the expected returnClass isn't the same as the transformed data

getEndpoint

public UMOImmutableEndpoint getEndpoint()
Description copied from interface: UMOBaseTransformer
The endpoint that this transformer is attached to

Specified by:
getEndpoint in interface UMOBaseTransformer
Returns:
the endpoint associated with the transformer

setEndpoint

public void setEndpoint(UMOImmutableEndpoint endpoint)
Description copied from interface: UMOBaseTransformer
Sets the endpoint associated with with this connector

Specified by:
setEndpoint in interface UMOBaseTransformer
Parameters:
endpoint - sets the endpoint associated with the transfromer

doTransform

protected abstract Object doTransform(InputStream src,
                                      OutputStream dest,
                                      String encoding)
                               throws TransformerException
Throws:
TransformerException

getNextTransformer

public UMOStreamingTransformer getNextTransformer()
Description copied from interface: UMOStreamingTransformer
Transformers can be chained together and invoked in a series

Specified by:
getNextTransformer in interface UMOStreamingTransformer
Returns:
the next transformer to invoke after this one

setNextTransformer

public void setNextTransformer(UMOStreamingTransformer nextTransformer)
Description copied from interface: UMOStreamingTransformer
Transformers can be chained together and invoked in a series

Specified by:
setNextTransformer in interface UMOStreamingTransformer
Parameters:
nextTransformer - the next transforer to invoke

clone

public Object clone()
             throws CloneNotSupportedException
Specified by:
clone in interface UMOBaseTransformer
Overrides:
clone in class Object
Throws:
CloneNotSupportedException

initialise

public void initialise()
                throws InitialisationException
Template method were deriving classes can do any initialisation after the properties have been set on this transformer

Specified by:
initialise in interface Initialisable
Throws:
InitialisationException
RecoverableException - if an error occurs that can be recovered from

generateTransformerName

protected String generateTransformerName()

isIgnoreBadInput

public boolean isIgnoreBadInput()

setIgnoreBadInput

public void setIgnoreBadInput(boolean ignoreBadInput)

toString

public String toString()
Overrides:
toString in class Object

isAcceptNull

public boolean isAcceptNull()


Copyright © 2003-2008 MuleSource, Inc.. All Rights Reserved.