org.ikasan.framework.component.routing
Class XPathBooleanRouter

java.lang.Object
  extended by org.ikasan.framework.component.routing.XPathBooleanRouter
All Implemented Interfaces:
Router, FlowComponent

public class XPathBooleanRouter
extends Object
implements Router

XPath router evaluation based on evaluating the incoming XPath expressions into Boolean results. Where these results are TRUE the associated XPath expression transition is added to the returned List for subsequent routing. The pre-configured parser and a map of XPath expressions and their associated transition name are passed to this class on construction.

Author:
Ikasan Development Team

Field Summary
 
Fields inherited from interface org.ikasan.framework.component.routing.Router
DEFAULT_RESULT
 
Constructor Summary
XPathBooleanRouter(DocumentBuilderFactory factory, Map<String,String> xpathExpressionToTransition)
          Constructor with no default transition supported.
XPathBooleanRouter(DocumentBuilderFactory factory, Map<String,String> xpathExpressionToTransition, boolean returnsDefaultForNonMatches)
          Constructor
 
Method Summary
 List<String> onEvent(Event event)
          Implementation of the onEvent XPathBooleanRoute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XPathBooleanRouter

public XPathBooleanRouter(DocumentBuilderFactory factory,
                          Map<String,String> xpathExpressionToTransition,
                          boolean returnsDefaultForNonMatches)
Constructor

Parameters:
factory - - configured DocumentBuilderFactory
xpathExpressionToTransition - - configured XPath expressions and associated transitions
returnsDefaultForNonMatches - - use the 'default' transition if no other transitions are matched

XPathBooleanRouter

public XPathBooleanRouter(DocumentBuilderFactory factory,
                          Map<String,String> xpathExpressionToTransition)
Constructor with no default transition supported.

Parameters:
factory - - configured DocumentBuilderFactory
xpathExpressionToTransition - - configured XPath expressions and associated transitions
Method Detail

onEvent

public List<String> onEvent(Event event)
                     throws RouterException
Implementation of the onEvent XPathBooleanRoute

Specified by:
onEvent in interface Router
Parameters:
event - The event to route
Returns:
List
Throws:
RouterException - Exception if we could not route the event


Copyright © 2007-2012 Ikasan. All Rights Reserved.