Class BeanRouter
- java.lang.Object
-
- org.smooks.cartridges.camel.routing.BeanRouter
-
- All Implemented Interfaces:
org.smooks.api.delivery.ContentHandler,org.smooks.api.delivery.ordering.Consumer,org.smooks.api.lifecycle.ExecutionLifecycleCleanable,org.smooks.api.lifecycle.ExecutionLifecycleInitializable,org.smooks.api.resource.visitor.sax.ng.AfterVisitor,org.smooks.api.resource.visitor.sax.ng.SaxNgVisitor,org.smooks.api.resource.visitor.Visitor
public class BeanRouter extends Object implements org.smooks.api.resource.visitor.sax.ng.AfterVisitor, org.smooks.api.delivery.ordering.Consumer, org.smooks.api.lifecycle.ExecutionLifecycleInitializable, org.smooks.api.lifecycle.ExecutionLifecycleCleanable
Camel bean routing visitor.
-
-
Constructor Summary
Constructors Constructor Description BeanRouter()BeanRouter(org.apache.camel.CamelContext camelContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanconsumes(Object object)voidexecuteExecutionLifecycleCleanup(org.smooks.api.ExecutionContext executionContext)voidexecuteExecutionLifecycleInitialize(org.smooks.api.ExecutionContext executionContext)voidpostConstruct()voidpreDestroy()protected voidsendBean(Object bean, org.smooks.api.ExecutionContext execContext)Send the bean to the target endpoint.BeanRoutersetBeanId(String beanId)Set the beanId of the bean to be routed.BeanRoutersetCorrelationIdName(String correlationIdName)Set the correlationId header name.BeanRoutersetCorrelationIdPattern(String correlationIdPattern)Set the correlationId pattern used to generate correlationIds.BeanRoutersetToEndpoint(String toEndpoint)Set the Camel endpoint to which the bean is to be routed.voidvisitAfter(Element element, org.smooks.api.ExecutionContext executionContext)
-
-
-
Method Detail
-
postConstruct
@PostConstruct public void postConstruct()
-
setBeanId
public BeanRouter setBeanId(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(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(String correlationIdName)
Set the correlationId header name.- Returns:
- This router instance.
-
setCorrelationIdPattern
public BeanRouter setCorrelationIdPattern(String correlationIdPattern)
Set the correlationId pattern used to generate correlationIds.- Parameters:
correlationIdPattern- The pattern generator template.- Returns:
- This router instance.
-
visitAfter
public void visitAfter(Element element, org.smooks.api.ExecutionContext executionContext) throws org.smooks.api.SmooksException
- Specified by:
visitAfterin interfaceorg.smooks.api.resource.visitor.sax.ng.AfterVisitor- Throws:
org.smooks.api.SmooksException
-
sendBean
protected void sendBean(Object bean, org.smooks.api.ExecutionContext execContext)
Send the bean to the target endpoint.- Parameters:
bean- The bean to be sent.execContext- The execution context.
-
preDestroy
@PreDestroy public void preDestroy()
-
consumes
public boolean consumes(Object object)
- Specified by:
consumesin interfaceorg.smooks.api.delivery.ordering.Consumer
-
executeExecutionLifecycleInitialize
public void executeExecutionLifecycleInitialize(org.smooks.api.ExecutionContext executionContext)
- Specified by:
executeExecutionLifecycleInitializein interfaceorg.smooks.api.lifecycle.ExecutionLifecycleInitializable
-
executeExecutionLifecycleCleanup
public void executeExecutionLifecycleCleanup(org.smooks.api.ExecutionContext executionContext)
- Specified by:
executeExecutionLifecycleCleanupin interfaceorg.smooks.api.lifecycle.ExecutionLifecycleCleanable
-
-