|
|||||||||
| 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.ClientGatewayConfiguration
public class ClientGatewayConfiguration
ClientGatewayConfiguration extends XMLConfiguration to configure a org.osesb.msgrouting.ClientGateway.
ClientGateway(s) facilitate communication with broker end points such as JMS Queues and web services. ClientGateway is used to hide messaging infrastructure from client applications. Client applications are not aware of target destinations, the message transport, or how a request is fulfilled. Initiating applications merely send a message, and possibly, receive a response. ClientGatewayConfiguration include a MessageRouterConfiguration. 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.
There are two ways that the message type for an outgoing message
is determined:
<clientGatewayMessageType> configuration element. In this case
all messages sent from the gateway will be assigned the same message type.<xmlMessagetypeHelperConfiguration> content model element of the
MessageRouterConfiguration.
Example ClientGatewayConfiguration content model:
<client-gateway-configuration>
<!-- debugFlag for ClientGateway -->
<debugFlag>false</debugFlag>
<!--
A ClientGateway can be configured with a static messageType by using the
<clientGatewayMessageType> configuration element. In this case
all messages sent from the gateway will be assigned the same message type.
messageTypes are QNames with a 'localPart' and an optional 'namespaceURI'.
If a ClientGateway is not configured with a static message type,
then it uses a XMLMessageTypeHelper to extract a message type from the
XML message using the <xmlmessage-messagetype-xpathexpression-list>
configuration element of the MessageRouterConfiguration.
-->
<clientGatewayMessageType></clientGatewayMessageType>
<!-- The MessageRouterConfiguration can be embedded or reference an external config file. -->
<message-router-configuration>
<!-- debugFlag for the MessageRouter -->
<debugFlag>false</debugFlag>
<!-- XPath expressions for extracting the localPart of the messageType from the XML message -->
<xmlmessage-messagetype-xpathexpression-list>
<!--
namespace-qualified XPath expressions
-->
<xmlmessage namespaceURI="http://osesb.test.com/attachment">
<!-- attachments-1.xml -->
<xpathExpression>testFiles/@messageType</xpathExpression>
</xmlmessage>
<xmlmessage namespaceURI="http://osesb.test.com/cdcatalog">
<!-- cdcatalog.xml -->
<xpathExpression>catalog/@messageType</xpathExpression>
</xmlmessage>
<!--
unqualified XPath expressions
-->
<xmlmessage>
</xmlmessage>
</xmlmessage-messagetype-xpathexpression-list>
<!--
A messageType maps to one, and only one MessagePipeline.
message-pipeline-configuration(s) can be configured inline or
reference an external configuration file.
If the message-pipeline-configuration 'enabled' attribute is false,
the MessagePipeline remains configured, but messages are not routed
to the MessagePipeline for processing.
enabled, defaults to true.
-->
<messagetype-to-messagepipeline-map key-class="org.osesb.configuration.QNameMapEntry">
<!--
All messageTypes mapped to the same MessagePipeline.
The MessagePipeline is configured with a single JMSClientPipelineStage
that sends messages to the deployed transport handler,
org.osesb.transporthandlers.jms.mdb.JMSXMLMessageTransportHandlerMDB.
-->
<!-- cdcatalog.xml -->
<message-type namespaceURI="http://osesb.test.com/cdcatalog" localPart="cdOrder_1">
<message-pipeline-configuration
configFile="org/osesb/transporthandlers/test/deployabletestpackage1/testdata/messagepipeline-for-clientgateway-to-JMSXMLMessageTransportHandlerMDB-config.xml"/>
</message-type>
<!-- cdcatalog.xml -->
<message-type namespaceURI="http://osesb.test.com/cdcatalog" localPart="cdOrder_2">
<message-pipeline-configuration
configFile="org/osesb/transporthandlers/test/deployabletestpackage1/testdata/messagepipeline-for-clientgateway-to-SOAPXMLMessageTransportHandlerBean-config.xml"/>
</message-type>
<!-- attachments-1.xml -->
<message-type namespaceURI="http://osesb.test.com/attachment" localPart="processAttachments">
<message-pipeline-configuration
configFile="org/osesb/transporthandlers/test/deployabletestpackage1/testdata/messagepipeline-for-clientgateway-to-JMSXMLMessageTransportHandlerMDB-config.xml"/>
</message-type>
</messagetype-to-messagepipeline-map>
</message-router-configuration>
</client-gateway-configuration>
| Field Summary | |
|---|---|
static java.lang.String |
CLIENT_GATEWAY_CONFIG_CONTENTMODEL
The content model tag for a ClientGatewayConfiguration. |
protected javax.xml.namespace.QName |
clientGatewayMessageType
From the <clientGatewayMessageType> configuration element, which
includes a 'namespaceURI' attribute and a 'localPart' attribute
that define the messageType (QName) that will be associated
with all messages sent form the configured ClientGateway. |
protected MessageRouterConfiguration |
messageRouterConfiguration
The MessageRouterConfiguration for this ClientGatewayConfiguration. |
| Fields inherited from class org.osesb.configuration.XMLConfiguration |
|---|
configFilePath, configurationProperties, constructedFromConfigFile, contentModelElement, ftpClientConfiguration, jaxrpcClientConfiguration, jdbcConfiguration, jmsClientConfiguration, log, rootConfigurationAttributes, smtpClientConfiguration, systemProperties, thisClassName |
| Constructor Summary | |
|---|---|
ClientGatewayConfiguration(org.w3c.dom.Element contentModelElement)
Creates a new instance of ClientGatewayConfiguration given the content model Element. |
|
ClientGatewayConfiguration(java.lang.String configFile)
Creates a new instance of ClientGatewayConfiguration given a XML configuration file. |
|
ClientGatewayConfiguration(java.lang.String configFile,
java.lang.String xpathExpression)
Creates a new instance of ClientGatewayConfiguration given a XML configuration file and a XPath expression that evaluates to the element that marks the beginning of the configuration. |
|
| Method Summary | |
|---|---|
javax.xml.namespace.QName |
getClientGatewayMessageType()
A ClientGateway can have a static messageType that will be set for all outgoing messages. |
MessageRouterConfiguration |
getMessageRouterConfiguration()
Return the MessageRouterConfiguration for this ClientGatewayConfiguration. |
java.lang.String |
getPoolKey()
Returns the poolKey for the ClientGateway. |
boolean |
isPooled()
Returns the isPooled flag, which indicates that this is a pooled ClientGateway. |
protected void |
loadClientGatewayMessageType()
A ClientGateway can have a static messageType that will be set for all outgoing messages. |
protected void |
loadMessageRouterConfiguration()
Loads a MessageRouterConfiguration that is enclosed within this ClientGatewayConfiguration. |
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. |
void |
setIsPooled(boolean isPooled)
Sets the isPooled flag, which indicates that this is a pooled ClientGateway. |
void |
setPoolKey(java.lang.String poolKey)
Set the poolKey for the ClientGateway. |
java.lang.String |
toString()
Returns the String representation of this ClientGatewayConfiguration. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected MessageRouterConfiguration messageRouterConfiguration
loadMessageRouterConfiguration()protected javax.xml.namespace.QName clientGatewayMessageType
<clientGatewayMessageType> configuration element, which
includes a 'namespaceURI' attribute and a 'localPart' attribute
that define the messageType (QName) that will be associated
with all messages sent form the configured ClientGateway.
A ClientGateway can have a static messageType
that will be set for all outgoing messages.
The messageType is used by the configured MessageRouter
to route a message to a MessagePipeline for processing.
If not specified, the messageType is determined
by the configured org.osesb.msgrouting.MessageRouter
according to the <xmlmessage-messagetype-xpathexpression-list>
configuration element of the MessageRouterConfiguration.
loadClientGatewayMessageType()public static final java.lang.String CLIENT_GATEWAY_CONFIG_CONTENTMODEL
| Constructor Detail |
|---|
public ClientGatewayConfiguration(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 ClientGatewayConfiguration(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 ClientGatewayConfiguration(s),
xpathExpression should have 'client-gateway-configuration'
as the last Element in the path.
java.lang.Exception - if there is a problem reading or parsing the
configuration file.
public ClientGatewayConfiguration(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 loadMessageRouterConfiguration()
throws java.lang.Exception
java.lang.Exception - if there is a problem loading the MessageRouterConfiguration.protected final void loadClientGatewayMessageType()
<clientGatewayMessageType>
configuration element, which includes a 'namespaceURI'
attribute and a 'localPart' attribute that define the
messageType (QName) that will be associated with all messages
sent form the configured ClientGateway.
The messageType is used by the configured MessageRouter to
route a message to a MessagePipeline for processing.
If <clientGatewayMessageType> is not configured, the
configured MessageRouter determines the messageType
using a XMLMessageTypeHelper to extract a message type.
For example DefaultXMLMessageTypeHelper applies a List of
XPath expressions to a XML message in order to extract
the message type.
public MessageRouterConfiguration getMessageRouterConfiguration()
loadMessageRouterConfiguration()public javax.xml.namespace.QName getClientGatewayMessageType()
<clientGatewayMessageType> configuration
element, which includes a 'namespaceURI' attribute and a
'localPart' attribute that define the messageType (QName)
that will be associated with all messages sent form the
configured ClientGateway.
The messageType is used by the configured MessageRouter
to route a message to a MessagePipeline for processing.
If <clientGatewayMessageType> is not configured, the
configured MessageRouter determines the messageType
using a XMLMessageTypeHelper to extract a message type.
For example DefaultXMLMessageTypeHelper applies a List of
XPath expressions to a XML message in order to extract
the message type.
loadClientGatewayMessageType()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 boolean isPooled()
public void setIsPooled(boolean isPooled)
isPooled - The ClientGateway isPooled flag.public java.lang.String getPoolKey()
public void setPoolKey(java.lang.String poolKey)
poolKey - the ClientGateway poolKey.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 | ||||||||