org.milyn.smooks.camel.processor
Class SmooksProcessor

java.lang.Object
  extended by org.milyn.smooks.camel.processor.SmooksProcessor
All Implemented Interfaces:
org.apache.camel.CamelContextAware, org.apache.camel.Processor, org.apache.camel.Service

public class SmooksProcessor
extends java.lang.Object
implements org.apache.camel.Processor, org.apache.camel.Service, org.apache.camel.CamelContextAware

Smooks Processor for Camel.

Author:
Christian Mueller, Daniel Bevenius

Field Summary
static java.lang.String CAMEL_CHARACTER_ENCODING
           
static java.lang.String SMOOKS_EXECUTION_CONTEXT
           
 
Constructor Summary
SmooksProcessor(org.apache.camel.CamelContext camelContext)
           
SmooksProcessor(Smooks smooks, org.apache.camel.CamelContext camelContext)
           
SmooksProcessor(java.lang.String configUri, org.apache.camel.CamelContext camelContext)
           
 
Method Summary
 SmooksProcessor addVisitor(VisitorAppender appender)
          Add a visitor instance to this Smooks instance via a VisitorAppender.
 SmooksProcessor addVisitor(Visitor visitor, java.lang.String targetSelector)
          Add a visitor instance.
 org.apache.camel.CamelContext getCamelContext()
           
 java.lang.String getSmooksConfig()
           
 void process(org.apache.camel.Exchange exchange)
           
 void setCamelContext(org.apache.camel.CamelContext camelContext)
           
 void setReportPath(java.lang.String reportPath)
           
protected  void setResultOnBody(Exports exports, javax.xml.transform.Result[] results, org.apache.camel.Exchange exchange)
           
 void setSmooksConfig(java.lang.String smooksConfig)
           
 void start()
           
 void stop()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SMOOKS_EXECUTION_CONTEXT

public static final java.lang.String SMOOKS_EXECUTION_CONTEXT
See Also:
Constant Field Values

CAMEL_CHARACTER_ENCODING

public static final java.lang.String CAMEL_CHARACTER_ENCODING
See Also:
Constant Field Values
Constructor Detail

SmooksProcessor

public SmooksProcessor(org.apache.camel.CamelContext camelContext)

SmooksProcessor

public SmooksProcessor(Smooks smooks,
                       org.apache.camel.CamelContext camelContext)

SmooksProcessor

public SmooksProcessor(java.lang.String configUri,
                       org.apache.camel.CamelContext camelContext)
                throws java.io.IOException,
                       org.xml.sax.SAXException
Throws:
java.io.IOException
org.xml.sax.SAXException
Method Detail

process

public void process(org.apache.camel.Exchange exchange)
             throws java.lang.Exception
Specified by:
process in interface org.apache.camel.Processor
Throws:
java.lang.Exception

setResultOnBody

protected void setResultOnBody(Exports exports,
                               javax.xml.transform.Result[] results,
                               org.apache.camel.Exchange exchange)

getSmooksConfig

public java.lang.String getSmooksConfig()

setSmooksConfig

public void setSmooksConfig(java.lang.String smooksConfig)

addVisitor

public SmooksProcessor addVisitor(Visitor visitor,
                                  java.lang.String targetSelector)
Add a visitor instance.

Parameters:
visitor - The visitor implementation.
targetSelector - The message fragment target selector.
Returns:
This instance.

addVisitor

public SmooksProcessor addVisitor(VisitorAppender appender)
Add a visitor instance to this Smooks instance via a VisitorAppender.

Parameters:
appender - The visitor appender.
Returns:
This instance.

setReportPath

public void setReportPath(java.lang.String reportPath)

start

public void start()
           throws java.lang.Exception
Specified by:
start in interface org.apache.camel.Service
Throws:
java.lang.Exception

stop

public void stop()
          throws java.lang.Exception
Specified by:
stop in interface org.apache.camel.Service
Throws:
java.lang.Exception

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

setCamelContext

public void setCamelContext(org.apache.camel.CamelContext camelContext)
Specified by:
setCamelContext in interface org.apache.camel.CamelContextAware

getCamelContext

public org.apache.camel.CamelContext getCamelContext()
Specified by:
getCamelContext in interface org.apache.camel.CamelContextAware


Copyright © 2011. All Rights Reserved.