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 aBeanContextLifecycleObserverthat 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanconditionsMatch(org.smooks.api.bean.lifecycle.BeanContextLifecycleEvent event)voidonBeanLifecycleEvent(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.voidsetConditionEvaluator(org.smooks.api.expression.ExecutionContextExpressionEvaluator conditionEvaluator)Set the condition evaluator for performing the routing.
-
-
-
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 SmooksBeanContext.
-
-
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:
onBeanLifecycleEventin interfaceorg.smooks.api.bean.lifecycle.BeanContextLifecycleObserver
-
conditionsMatch
public boolean conditionsMatch(org.smooks.api.bean.lifecycle.BeanContextLifecycleEvent event)
-
-