|
|||||||||
| 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.MessageRouterConfiguration
public class MessageRouterConfiguration
XML configuration for a MessageRouter.
MessageRouterConfiguration encapsulates:<xmlMessagetypeHelperConfiguration>
element of the MessageRouterConfiguration and the XMLMessageTypeHelperConfiguration
class is used to encapsulate this configuration element.<messagetype-to-messagepipeline-map> element of the
MessageRouterConfiguration. A org.osesb.configuration.XMLMappedConfiguration
is used to encapsulate this configuration element.<messagetype-to-messagepipeline-map> configuration
element of a MessageRouterConfiguration to map message types
to MessagePipelines.
Example <messagetype-to-messagepipeline-map> content model:
<messagetype-to-messagepipeline-map key-class="org.osesb.configuration.QNameMapEntry">
<!-- Five different cdOrder messageTypes for testing MessageRouter and ClientGateway.
See MessageRouter#main() and ClientGateway#main() -->
<message-type namespaceURI="http://osesb.test.com/cdcatalog" localPart="cdOrder_1">
<message-pipeline-configuration enabled=""
configFile="org/osesb/msgrouting/test/deployabletestpackage1/message-pipeline-1-test-config.xml"/>
</message-type>
<!-- cdcatalog.xml -->
<message-type namespaceURI="http://osesb.test.com/cdcatalog" localPart="cdOrder_2">
<message-pipeline-configuration enabled=""
configFile="org/osesb/msgrouting/test/deployabletestpackage1/message-pipeline-2-test-config.xml"/>
</message-type>
<!-- cdcatalog.xml -->
<message-type namespaceURI="http://osesb.test.com/cdcatalog" localPart="cdOrder_3">
<message-pipeline-configuration enabled=""
configFile="org/osesb/msgrouting/test/deployabletestpackage1/message-pipeline-3-test-config.xml"/>
</message-type>
<!-- cdcatalog.xml -->
<message-type namespaceURI="http://osesb.test.com/cdcatalog" localPart="cdOrder_4">
<message-pipeline-configuration enabled=""
configFile="org/osesb/msgrouting/test/deployabletestpackage1/message-pipeline-4-test-config.xml"/>
</message-type>
<!-- cdcatalog.xml -->
<message-type namespaceURI="http://osesb.test.com/cdcatalog" localPart="cdOrder_5">
<message-pipeline-configuration enabled=""
configFile="org/osesb/msgrouting/test/deployabletestpackage1/message-pipeline-5-test-config.xml"/>
</message-type>
<!-- attachments-1.xml -->
<message-type namespaceURI="http://osesb.test.com/attachment" localPart="processAttachments">
<message-pipeline-configuration enabled=""
configFile="org/osesb/msgrouting/test/deployabletestpackage1/message-pipeline-6-test-config.xml"/>
</message-type>
</messagetype-to-messagepipeline-map>
See the org.osesb.messagepipeline package.
See the org.osesb.transporthandlers package in the transport-handlers module.
There are two ways that the message type for message is determined:
<xmlMessagetypeHelperConfiguration> content model element of the
MessageRouterConfiguration, which 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...</helper-config>
</xmlMessagetypeHelperConfiguration>
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 | |
|---|---|
static java.lang.String |
MESSAGEROUTERCONFIG_CONTENTMODEL
Content model tag for a Router configuration. |
static java.lang.String |
MESSAGETYPE_TO_MESSAGEPIPELINE_MAP_CONFIG_CONTENTMODEL
XMLMessageTypeToMessagePipelineConfiguration content model tag. |
protected XMLMessageTypeHelperConfiguration |
xmlMessageTypeHelperConfiguration
xmlMessageTypeHelperConfiguration, which encapsulates the <xmlMessagetypeHelperConfiguration> configuration
element, which configures an optional XMLMessageTypeHelper. |
protected XMLMappedConfiguration |
xmlMessageTypeToMessagePipelineConfiguration
xmlMessageTypeToMessagePipelineConfiguration, which encapsulates the <messagetype-to-messagepipeline-map> configuration
element, which is a map of message types to MessagePipelines. |
| Fields inherited from class org.osesb.configuration.XMLConfiguration |
|---|
configFilePath, configurationProperties, constructedFromConfigFile, contentModelElement, ftpClientConfiguration, jaxrpcClientConfiguration, jdbcConfiguration, jmsClientConfiguration, log, rootConfigurationAttributes, smtpClientConfiguration, systemProperties, thisClassName |
| Constructor Summary | |
|---|---|
MessageRouterConfiguration(org.w3c.dom.Element contentModelElement)
Creates a new instance of MessageRouterConfiguration given the content model Element. |
|
MessageRouterConfiguration(java.lang.String configFile)
Creates a new instance of MessageRouterConfiguration given a XML configuration file. |
|
MessageRouterConfiguration(java.lang.String configFile,
java.lang.String xpathExpression)
Creates a new instance of MessageRouterConfiguration given a XML configuration file and a XPath expression that evaluates to the element that marks the beginning of the configuration. |
|
| Method Summary | |
|---|---|
XMLMessageTypeHelperConfiguration |
getXMLMessageTypeHelperConfiguration()
Returns the xmlMessageTypeHelperConfiguration, , which encapsulates the <xmlMessagetypeHelperConfiguration> configuration
element, which configures an optional XMLMessageTypeHelper. |
XMLMappedConfiguration |
getXMLMessageTypeToMessagePipelineConfiguration()
Returns the xmlMessageTypeToMessagePipelineConfiguration, which encapsulates the <messagetype-to-messagepipeline-map> configuration
element. |
protected void |
loadXMLMessageTypeHelperConfiguration()
Loads the xmlMessageTypeHelperConfiguration, which configures an optional XMLMessageTypeHelper. |
protected void |
loadXMLMessageTypeToMessagePipelineConfiguration()
Loads the xmlMessageTypeToMessagePipelineConfiguration, which configures a map of message types to MessagePipelines. |
static void |
main(java.lang.String[] args)
main() - For testing and sandbboxing. |
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 XMLMessageTypeHelperConfiguration xmlMessageTypeHelperConfiguration
<xmlMessagetypeHelperConfiguration> configuration
element, which configures an optional XMLMessageTypeHelper.
protected XMLMappedConfiguration xmlMessageTypeToMessagePipelineConfiguration
<messagetype-to-messagepipeline-map> configuration
element, which is a map of message types to MessagePipelines.
public static final java.lang.String MESSAGEROUTERCONFIG_CONTENTMODEL
public static java.lang.String MESSAGETYPE_TO_MESSAGEPIPELINE_MAP_CONFIG_CONTENTMODEL
| Constructor Detail |
|---|
public MessageRouterConfiguration(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 MessageRouterConfiguration(java.lang.String configFile,
java.lang.String xpathExpression)
throws java.lang.Exception
configFile - The XML configuration document to parse.xpathExpression - A XPath expression that evaluates to the
element that marks the beginning of the
configuration. If following the framework
convention for MessageRouterConfiguration(s),
xpathExpression should have 'message-router-configuration'
as the last Element in the path.
java.lang.Exception - if there is a problem reading or parsing the
configuration file.
public MessageRouterConfiguration(org.w3c.dom.Element contentModelElement)
throws java.lang.Exception
contentModelElement - The top level Element for the
for the configuration.
java.lang.Exception - if there is a fatal error transversing the
configuration content model enclosed by contentModelElement.| Method Detail |
|---|
protected final void loadXMLMessageTypeHelperConfiguration()
throws java.lang.Exception
<xmlMessagetypeHelperConfiguration> content model element of the
MessageRouterConfiguration.
Note that this method should not be overridden as it is invoked
from this class's constructor.
java.lang.Exception - if there is a fatal error transversing the DOM
that contains the configuration content model.
protected final void loadXMLMessageTypeToMessagePipelineConfiguration()
throws java.lang.Exception
<messagetype-to-messagepipeline-map> configuration
element of a MessageRouterConfiguration to map message types
to MessagePipelines.
Note that this method should not be overridden as it is invoked
from this class's constructor.
java.lang.Exception - if there is a fatal error transversing the DOM
that contains the configuration content model.public XMLMessageTypeHelperConfiguration getXMLMessageTypeHelperConfiguration()
<xmlMessagetypeHelperConfiguration> configuration
element, which configures an optional XMLMessageTypeHelper.
<xmlMessagetypeHelperConfiguration> configuration
element, which configures an optional XMLMessageTypeHelper.public XMLMappedConfiguration getXMLMessageTypeToMessagePipelineConfiguration()
<messagetype-to-messagepipeline-map> configuration
element.
<messagetype-to-messagepipeline-map> configuration
element.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)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||