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.
Author:
tom.fennelly@gmail.com, daniel.bevenius@gmail.com
  • Constructor Details

    • BeanRouter

      public BeanRouter()
    • BeanRouter

      public BeanRouter(org.apache.camel.CamelContext camelContext)
  • Method Details

    • 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:
      visitAfter in interface org.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:
      consumes in interface org.smooks.api.delivery.ordering.Consumer
    • onPostExecution

      public void onPostExecution(org.smooks.api.ExecutionContext executionContext)
      Specified by:
      onPostExecution in interface org.smooks.api.lifecycle.PostExecutionLifecycle
    • onPreExecution

      public void onPreExecution(org.smooks.api.ExecutionContext executionContext)
      Specified by:
      onPreExecution in interface org.smooks.api.lifecycle.PreExecutionLifecycle