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.PostExecutionLifecycle,org.smooks.api.lifecycle.PreExecutionLifecycle,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.PreExecutionLifecycle, org.smooks.api.lifecycle.PostExecutionLifecycle
Camel bean routing visitor.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidonPostExecution(org.smooks.api.ExecutionContext executionContext) voidonPreExecution(org.smooks.api.ExecutionContext executionContext) voidvoidprotected voidSend the bean to the target endpoint.Set the beanId of the bean to be routed.setCorrelationIdName(String correlationIdName) Set the correlationId header name.setCorrelationIdPattern(String correlationIdPattern) Set the correlationId pattern used to generate correlationIds.setToEndpoint(String toEndpoint) Set the Camel endpoint to which the bean is to be routed.voidvisitAfter(Element element, org.smooks.api.ExecutionContext executionContext)
-
Constructor Details
-
BeanRouter
public BeanRouter() -
BeanRouter
public BeanRouter(org.apache.camel.CamelContext camelContext)
-
-
Method Details
-
postConstruct
@PostConstruct public void postConstruct() -
setBeanId
Set the beanId of the bean to be routed.- Parameters:
beanId- the beanId to set- Returns:
- This router instance.
-
setToEndpoint
Set the Camel endpoint to which the bean is to be routed.- Parameters:
toEndpoint- the toEndpoint to set- Returns:
- This router instance.
-
setCorrelationIdName
Set the correlationId header name.- Returns:
- This router instance.
-
setCorrelationIdPattern
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
Send the bean to the target endpoint.- Parameters:
bean- The bean to be sent.execContext- The execution context.
-
preDestroy
@PreDestroy public void preDestroy() -
consumes
- Specified by:
consumesin interfaceorg.smooks.api.delivery.ordering.Consumer
-
onPostExecution
public void onPostExecution(org.smooks.api.ExecutionContext executionContext) - Specified by:
onPostExecutionin interfaceorg.smooks.api.lifecycle.PostExecutionLifecycle
-
onPreExecution
public void onPreExecution(org.smooks.api.ExecutionContext executionContext) - Specified by:
onPreExecutionin interfaceorg.smooks.api.lifecycle.PreExecutionLifecycle
-