org.osesb.msgrouting
Class AbstractXMLMessageTypeHelper

java.lang.Object
  extended by org.osesb.msgrouting.AbstractXMLMessageTypeHelper
Direct Known Subclasses:
CustomTestXMLMessageTypeHelper_Test1, DefaultXMLMessageTypeHelper

public abstract class AbstractXMLMessageTypeHelper
extends java.lang.Object

Ancestor for XMLMessageTypeHelper(s).

Transport handlers and ClientGateway(s) use a MessageRouter to route messages to a org.osesb.messagepipeline.MessagePipeline for processing. The MessageRouter selects the MessagePipeline based on the message's messageType. The MessageRouter uses the <messagetype-to-messagepipeline-map> configuration element of a MessageRouterConfiguration to map message types to MessagePipelines.

See the org.osesb.messagepipeline package. See org.osesb.msgrouting.ClientGateway. See the org.osesb.transporthandlers package in the transport-handlers module.

There are two ways that the message type is determined:

  1. Transport handlers and ClientGateway(s) can be configured with a static messageType. In this case all messages arriving at a transport handler will be assigned the same message type and all messages sent to osESB by a ClientGateway are assigned the same message type.
  2. If a transport handler or ClientGateway is not configured with a static message type, then the configured MessageRouter uses a XMLMessageTypeHelper to extract a message type from the XML message.

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.


Field Summary
protected  boolean debugFlag
          The debugFlag for this Object.
 
Constructor Summary
AbstractXMLMessageTypeHelper()
           
 
Method Summary
abstract  javax.xml.namespace.QName getMessageType(java.lang.String xmlText)
          Extract a message type from a XML message as a QName.
 void setDebugFlag(boolean debugFlag)
          Set the debugFlag for this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debugFlag

protected boolean debugFlag
The debugFlag for this Object.

Constructor Detail

AbstractXMLMessageTypeHelper

public AbstractXMLMessageTypeHelper()
Method Detail

getMessageType

public abstract javax.xml.namespace.QName getMessageType(java.lang.String xmlText)
                                                  throws java.lang.Exception,
                                                         MessageTypeNotFoundException
Extract a message type from a XML message as a QName.

Parameters:
xmlText - The XML text to extract the message type from.
Returns:
A QName that represents the message type.
Throws:
java.lang.Exception - if there was a general error extracting the message type.
MessageTypeNotFoundException - if the message type was not found.

setDebugFlag

public void setDebugFlag(boolean debugFlag)
Set the debugFlag for this object.

Parameters:
debugFlag - If true, debug messages are logged.