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

      • BeanRouter

        public BeanRouter()
      • BeanRouter

        public BeanRouter​(org.apache.camel.CamelContext camelContext)
    • 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:
        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
      • executeExecutionLifecycleInitialize

        public void executeExecutionLifecycleInitialize​(org.smooks.api.ExecutionContext executionContext)
        Specified by:
        executeExecutionLifecycleInitialize in interface org.smooks.api.lifecycle.ExecutionLifecycleInitializable
      • executeExecutionLifecycleCleanup

        public void executeExecutionLifecycleCleanup​(org.smooks.api.ExecutionContext executionContext)
        Specified by:
        executeExecutionLifecycleCleanup in interface org.smooks.api.lifecycle.ExecutionLifecycleCleanable