Class 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 Detail

      • 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 Detail

      • 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)