|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.osesb.configuration.XMLConfiguration
org.osesb.msgrouting.configuration.XMLMessageTypeHelperConfiguration
public class XMLMessageTypeHelperConfiguration
XMLMessageTypeHelperConfiguration is not a stand-alone configuration class; it configures a XMLMessageTypeHelper within a MessageRouterConfiguration.
XMLMessageTypeHelperConfiguration encapsulates the<xmlMessagetypeHelperConfiguration> element of the
MessageRouterConfiguration, which configures the
XMLMessageTypeHelper that is used by a MessageRouter to
extract message types from XML messages.
Out of the box, osESB provides two XMLMessageTypeHelper
classes, both descendants of
org.osesb.msgrouting.AbstractXMLMessageTypeHelper:
<xmlMessagetypeHelperConfiguration> content model
element looks like:
<xmlMessagetypeHelperConfiguration>
<!-- The MessagetypeHelper class. -->
<helper-class>org.osesb.msgrouting.test.CustomTestXMLMessageTypeHelper_Test2</helper-class>
<!--
A fully qualified helper configuration class name is optional.
If <helper-config> is empty, then this element is not used.
If <helper-config> is not empty, then the specified class is
constructed from the <helper-config> element. If <helper-config>
is not empty and this element is not specified, then a XMLConfiguration
is constructed from the <helper-config> element.
If a helper configuration is constructed, then it is passed
to the constructor of the <helper-class> when the helper class
is constructed by MessageRouter.
-->
<helper-config-class>org.osesb.msgrouting.configuration.XMLMessageTypeXPathExpressionListConfiguratio</helper-config-class>
<helper-config>
The configuration content model for the helper class.
See XMLMessageTypeXPathExpressionListConfiguration and DroolsXMLMessageTypeHelperConfiguration
</helper-config>
</xmlMessagetypeHelperConfiguration>
A message entering osESB through one of the transport
handlers (see the org.osesb.transporthandlers package)
must have a message type. Since osESB is configured
mostly to handle XML messages (possibly with attachments)
the message type is a QName where the namespaceURI is the
namespace of the XML message and the local part is given
by an element or attribute in the message.
Transport handlers 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.
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.
To configure a MessageRouter with a different XMLMessageTypeHelper, create a
class that extends AbstractXMLMessageTypeHelper and use the
<xmlMessagetypeHelperConfiguration> content model element of the
MessageRouterConfiguration.
| Field Summary | |
|---|---|
protected XMLConfiguration |
helperConfiguration
The configuration for the XMLMessageTypeHelper class given by the <helper-class> tag. |
static java.lang.String |
XMLMESSAGETYPEHELPERCONFIG_CONTENTMODEL
XMLMessageTypeHelperConfiguration content model tag. |
| Fields inherited from class org.osesb.configuration.XMLConfiguration |
|---|
configFilePath, configurationProperties, constructedFromConfigFile, contentModelElement, ftpClientConfiguration, jaxrpcClientConfiguration, jdbcConfiguration, jmsClientConfiguration, log, rootConfigurationAttributes, smtpClientConfiguration, systemProperties, thisClassName |
| Constructor Summary | |
|---|---|
XMLMessageTypeHelperConfiguration()
Creates a new empty instance of XMLMessageTypeHelperConfiguration. |
|
XMLMessageTypeHelperConfiguration(org.w3c.dom.Element contentModelElement)
Creates a new instance of XMLMessageTypeHelperConfiguration given the content model Element that encloses the configuration. |
|
XMLMessageTypeHelperConfiguration(java.lang.String configFile)
Creates a new instance of XMLMessageTypeHelperConfiguration given a XML configuration file. |
|
XMLMessageTypeHelperConfiguration(java.lang.String configFile,
java.lang.String xpathExpression)
Creates a new instance of XMLMessageTypeHelperConfiguration given a XML configuration file and a XPath expression that evaluates to the element that marks the beginning of the configuration. |
|
| Method Summary | |
|---|---|
java.lang.String |
getHelperClassNameName()
Returns the name of the XMLMessageTypeHelper class. |
XMLConfiguration |
getHelperConfiguration()
Returns the helperConfiguration, which is enclosed by the <helper-config>
element, which contains the application-specific properties that are required
by the XMLMessageTypeHelper. |
java.lang.String |
getHelperConfigurationClassNameName()
Returns the name of the class used to configure the XMLMessageTypeHelper. |
protected void |
loadHelperConfiguration()
Loads the <helper-config> element into this.helperConfiguration. |
static void |
main(java.lang.String[] args)
main() For testing. |
void |
setConfigFilePath(java.lang.String configFile)
Set the configuration file name. |
void |
setDebugFlag(boolean debugFlag)
Set the debugFlag. |
java.lang.String |
toString()
Returns the String representation of this MessageRouterConfiguration. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected XMLConfiguration helperConfiguration
<helper-class> tag. The helperConfiguration is enclosed
by the <helper-config> tag and the specific helperConfiguration
class is given by the <helper-config-class> tag. helperConfiguration
must extend XMLConfiguration.
loadHelperConfiguration()public static final java.lang.String XMLMESSAGETYPEHELPERCONFIG_CONTENTMODEL
| Constructor Detail |
|---|
public XMLMessageTypeHelperConfiguration()
public XMLMessageTypeHelperConfiguration(java.lang.String configFile)
throws java.lang.Exception
configFile - The path to the XML configuration file, which
is specified as a resource path or as a file system
path that is relative to the path specified
by the ConfigurationConstants.CONFIG_PATH_SYSTEMPROPERTY
System Property.
java.lang.Exception - if there is a problem reading or parsing the
configuration file.
public XMLMessageTypeHelperConfiguration(java.lang.String configFile,
java.lang.String xpathExpression)
throws java.lang.Exception
configFile - The path to the XML configuration file, which
is specified as a resource path or as a file system
path that is relative to the path specified
by the ConfigurationConstants.CONFIG_PATH_SYSTEMPROPERTY
System Property.xpathExpression - A XPath expression that evaluates to the
element that marks the beginning of the
configuration.
java.lang.Exception - if there is a problem reading or parsing the
configuration file.
public XMLMessageTypeHelperConfiguration(org.w3c.dom.Element contentModelElement)
throws java.lang.Exception
contentModelElement - the content model Element that
encloses the configuration.
java.lang.Exception - if there is a fatal error transversing the
configuration content model enclosed by contentModelElement.| Method Detail |
|---|
protected final void loadHelperConfiguration()
throws java.lang.Exception
<helper-config> element into this.helperConfiguration.
java.lang.Exception - if there is a fatal error transversing the
content model.public java.lang.String getHelperClassNameName()
public java.lang.String getHelperConfigurationClassNameName()
public XMLConfiguration getHelperConfiguration()
<helper-config>
element, which contains the application-specific properties that are required
by the XMLMessageTypeHelper.
public void setConfigFilePath(java.lang.String configFile)
setConfigFilePath in class XMLConfigurationconfigFile - the configuration file name.public void setDebugFlag(boolean debugFlag)
setDebugFlag in class XMLConfigurationdebugFlag - The debugFlag.public java.lang.String toString()
toString in class XMLConfigurationpublic static void main(java.lang.String[] args)
args - commandline arguments
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||