Class BeanRouterObserver

java.lang.Object
org.smooks.cartridges.camel.routing.BeanRouterObserver
All Implemented Interfaces:
org.smooks.api.bean.lifecycle.BeanContextLifecycleObserver

public class BeanRouterObserver extends Object implements org.smooks.api.bean.lifecycle.BeanContextLifecycleObserver
BeanRouterObserver is a BeanContextLifecycleObserver that will route a specified bean to the configured endpoint.

Author:
Daniel Bevenius
  • Constructor Summary

    Constructors
    Constructor
    Description
    BeanRouterObserver(BeanRouter beanRouter, String beanId)
    Sole contructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    conditionsMatch(org.smooks.api.bean.lifecycle.BeanContextLifecycleEvent event)
     
    void
    onBeanLifecycleEvent(org.smooks.api.bean.lifecycle.BeanContextLifecycleEvent event)
    Will route to the endpoint if the BeanLifecycle is of type BeanLifecycle.REMOVE and the beanId is equals to the beanId that was configured for this instance.
    void
    setConditionEvaluator(org.smooks.api.expression.ExecutionContextExpressionEvaluator conditionEvaluator)
    Set the condition evaluator for performing the routing.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BeanRouterObserver

      public BeanRouterObserver(BeanRouter beanRouter, String beanId)
      Sole contructor.
      Parameters:
      beanRouter - The bean router instance to be used for routing beans.
      beanId - The beanId which is the beanId in the Smooks BeanContext.
  • Method Details

    • setConditionEvaluator

      public void setConditionEvaluator(org.smooks.api.expression.ExecutionContextExpressionEvaluator conditionEvaluator)
      Set the condition evaluator for performing the routing.

      Used to test if the routing is to be performed based on the user configured condition.

      Parameters:
      conditionEvaluator - The routing condition evaluator.
    • onBeanLifecycleEvent

      public void onBeanLifecycleEvent(org.smooks.api.bean.lifecycle.BeanContextLifecycleEvent event)
      Will route to the endpoint if the BeanLifecycle is of type BeanLifecycle.REMOVE and the beanId is equals to the beanId that was configured for this instance.
      Specified by:
      onBeanLifecycleEvent in interface org.smooks.api.bean.lifecycle.BeanContextLifecycleObserver
    • conditionsMatch

      public boolean conditionsMatch(org.smooks.api.bean.lifecycle.BeanContextLifecycleEvent event)