|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.osesb.msgrouting.AbstractXMLMessageTypeHelper
org.osesb.msgrouting.DefaultXMLMessageTypeHelper
org.osesb.msgrouting.DroolsXMLMessageTypeHelper
public class DroolsXMLMessageTypeHelper
DroolsXMLMessageTypeHelper extends DefaultXMLMessageTypeHelper with a getMessageType() method that incorporates a Drools rule.
DefaultXMLMessageTypeHelper is the default XMLMessageTypeHelper class and is constructed with a XMLMessageTypeXPathExpressionListConfiguration. DefaultXMLMessageTypeHelper applies the configured XPath expressions to a XML message until a messageType is determined. DefaultXMLMessageTypeHelper#getMessagetype() returns the messageType as a QName, where the namespaceURI is the XML document namespace (if any) and the localPart is the value for the element or attribute that is given by a XPath expression that is configured in the XMLMessageTypeXPathExpressionListConfiguration. DroolsXMLMessageTypeHelper is constructed with a DroolsXMLMessageTypeHelperConfiguration, which combines XMLMessageTypeXPathExpressionListConfiguration and DroolsRuleApplierConfiguration. DroolsXMLMessageTypeHelper allows for more complex determination of the messageType for a XML message as follows:
| Field Summary | |
|---|---|
protected DroolsXMLMessageTypeHelperConfiguration |
droolsXMLMessageTypeHelperConfiguration
The DroolsXMLMessageTypeHelperConfiguration which combines XMLMessageTypeXPathExpressionListConfiguration and DroolsRuleApplierConfiguration. |
protected XMLDroolsRuleApplier |
xmlDroolsRuleApplier
XMLDroolsRuleApplier applies Drools rules to the values extracted from XML using XPath Expressions. |
| Fields inherited from class org.osesb.msgrouting.DefaultXMLMessageTypeHelper |
|---|
documentNamespaceHelper, log, saxXPathElementHandler, thisClassName, xmlMessageTypeXPathExpressionListConfiguration |
| Fields inherited from class org.osesb.msgrouting.AbstractXMLMessageTypeHelper |
|---|
debugFlag |
| Constructor Summary | |
|---|---|
DroolsXMLMessageTypeHelper(DroolsXMLMessageTypeHelperConfiguration droolsXMLMessageTypeHelperConfiguration)
Creates a new instance of DefaultXMLMessageTypeHelper. |
|
| Method Summary | |
|---|---|
javax.xml.namespace.QName |
getMessageType(java.lang.String xmlText)
Get a message type from a XML message according to the following plan: Invokes the ancestor method, which returns the messageType as a QName, where the namespaceURI is the XML document namespace (if any) and the localPart is the value for the element or attribute that is given by a XPath expression that is configured in the XMLMessageTypeXPathExpressionListConfiguration. DroolsXMLMessageTypeHelperConfiguration configures additional XPath expressions, which are passed to an instance of org.osesb.drools.XMLDroolsRuleApplier. |
XMLDroolsRuleApplier |
getXmlDroolsRuleApplier()
Get the XMLDroolsRuleApplier used by this DroolsXMLMessageTypeHelper. |
static void |
main(java.lang.String[] args)
Main method for testing. |
| Methods inherited from class org.osesb.msgrouting.DefaultXMLMessageTypeHelper |
|---|
getNamespaceQualifiedMessageType, getUnqualifiedMessageType, parseForMessageType, setDebugFlag |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected DroolsXMLMessageTypeHelperConfiguration droolsXMLMessageTypeHelperConfiguration
protected XMLDroolsRuleApplier xmlDroolsRuleApplier
| Constructor Detail |
|---|
public DroolsXMLMessageTypeHelper(DroolsXMLMessageTypeHelperConfiguration droolsXMLMessageTypeHelperConfiguration)
throws java.lang.Exception
droolsXMLMessageTypeHelperConfiguration - which combines
XMLMessageTypeXPathExpressionListConfiguration and DroolsRuleApplierConfiguration.
java.lang.Exception - if constructed with a null DroolsXMLMessageTypeHelperConfiguration
or if an error occurs while creating an instance of org.osesb.drools.XMLDroolsRuleApplier.| Method Detail |
|---|
public javax.xml.namespace.QName getMessageType(java.lang.String xmlText)
throws java.lang.Exception,
MessageTypeNotFoundException
getMessageType in class DefaultXMLMessageTypeHelperxmlText - The XML text to extract the message type from.
java.lang.Exception - if there was a general error extracting the message type.
MessageTypeNotFoundException - if the message type
could not be dtermined using the configured Drools rules.public XMLDroolsRuleApplier getXmlDroolsRuleApplier()
public static void main(java.lang.String[] args)
args - The test data directory.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||