org.milyn.smooks.camel.routing
Class BeanRouter

java.lang.Object
  extended by org.milyn.smooks.camel.routing.BeanRouter
All Implemented Interfaces:
ContentHandler, ExecutionLifecycleCleanable, ExecutionLifecycleInitializable, Consumer, SAXVisitAfter, SAXVisitor, Visitor

public class BeanRouter
extends java.lang.Object
implements SAXVisitAfter, Consumer, ExecutionLifecycleInitializable, ExecutionLifecycleCleanable

Camel bean routing visitor.

Author:
tom.fennelly@gmail.com, daniel.bevenius@gmail.com

Constructor Summary
BeanRouter()
           
BeanRouter(org.apache.camel.CamelContext camelContext)
           
 
Method Summary
 boolean consumes(java.lang.Object object)
           
 void executeExecutionLifecycleCleanup(ExecutionContext executionContext)
           
 void executeExecutionLifecycleInitialize(ExecutionContext executionContext)
           
 void initialize()
           
protected  void sendBean(java.lang.Object bean, ExecutionContext execContext)
          Send the bean to the target endpoint.
 BeanRouter setBeanId(java.lang.String beanId)
          Set the beanId of the bean to be routed.
 BeanRouter setCorrelationIdName(java.lang.String correlationIdName)
          Set the correlationId header name.
 BeanRouter setCorrelationIdPattern(java.lang.String correlationIdPattern)
          Set the correlationId pattern used to generate correlationIds.
 BeanRouter setToEndpoint(java.lang.String toEndpoint)
          Set the Camel endpoint to which the bean is to be routed.
 void uninitialize()
           
 void visitAfter(SAXElement element, ExecutionContext execContext)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanRouter

public BeanRouter()

BeanRouter

public BeanRouter(org.apache.camel.CamelContext camelContext)
Method Detail

initialize

@Initialize
public void initialize()

setBeanId

public BeanRouter setBeanId(java.lang.String beanId)
Set the beanId of the bean to be routed.

Parameters:
beanId - the beanId to set
Returns:
This router instance.

setToEndpoint

public BeanRouter setToEndpoint(java.lang.String toEndpoint)
Set the Camel endpoint to which the bean is to be routed.

Parameters:
toEndpoint - the toEndpoint to set
Returns:
This router instance.

setCorrelationIdName

public BeanRouter setCorrelationIdName(java.lang.String correlationIdName)
Set the correlationId header name.

Returns:
This router instance.

setCorrelationIdPattern

public BeanRouter setCorrelationIdPattern(java.lang.String correlationIdPattern)
Set the correlationId pattern used to generate correlationIds.

Parameters:
correlationIdPattern - The pattern generator template.
Returns:
This router instance.

visitAfter

public void visitAfter(SAXElement element,
                       ExecutionContext execContext)
                throws SmooksException,
                       java.io.IOException
Specified by:
visitAfter in interface SAXVisitAfter
Throws:
SmooksException
java.io.IOException

sendBean

protected void sendBean(java.lang.Object bean,
                        ExecutionContext execContext)
Send the bean to the target endpoint.

Parameters:
bean - The bean to be sent.
execContext - The execution context.

uninitialize

@Uninitialize
public void uninitialize()

consumes

public boolean consumes(java.lang.Object object)
Specified by:
consumes in interface Consumer

executeExecutionLifecycleInitialize

public void executeExecutionLifecycleInitialize(ExecutionContext executionContext)
Specified by:
executeExecutionLifecycleInitialize in interface ExecutionLifecycleInitializable

executeExecutionLifecycleCleanup

public void executeExecutionLifecycleCleanup(ExecutionContext executionContext)
Specified by:
executeExecutionLifecycleCleanup in interface ExecutionLifecycleCleanable


Copyright © 2011. All Rights Reserved.