|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.osesb.msgrouting.ClientGateway
public class ClientGateway
This class is used by application clients to send messages to osESB.
ClientGateway(s) facilitate communication with broker end points such as JMS Destinations 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. Like transport handlers, the ClientGateway is configured with a MessageRouter. In this case, the MessageRouter is used to select the MessagePipeline that sends an outgoing message to a osESB destination end point. Broker destination end-points are exposed by osESB transport handlers as JMS Destinations or web services. ClientGateway MessageRouter(s) are configured with MessagePipeline(s) that contain any number or types of PipelineStages and one PipelineStage that handles the interaction with a broker end point. We call this osESB transport PipelineStage. For example:<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:
<xmlMessagetypeHelperConfiguration> content model element of the
MessageRouterConfiguration.
The ClientGateway sendXXX methods return message IDs from the underlying
transport according to the following rules:
<wsa:MessageID> entry in the SOAPHeader of
the message that was received.<wsa:RelatesTo> entry in the SOAPHeader of
the SOAP message that was received.<wsa:MessageID> entry in the SOAPHeader
of the message that was sent.
For multi-threaded environments or for any situation where an application
client needs to send multiple messages to osESB, use a pool of
ClientGateway(s) to send messages and possibly receive replies. This
approach may eliminate the need for the client to correlate multiple
request/reply interactions.
ClientGateway(s)can be pooled. See org.osesb.objectpools.ClientGatewayKeyedPoolFactory.
| Field Summary | |
|---|---|
protected ClientGatewayConfiguration |
clientGatewayConfiguration
The configuration for this ClientGateway, which includes at least a MessageRouterConfiguration. |
protected static org.apache.commons.logging.Log |
log
The logging implementation for this class. |
protected MessageRouter |
messageRouter
The MessageRouter for this ClientGateway. |
protected java.lang.String |
thisClassName
The full name of this class. |
| Constructor Summary | |
|---|---|
ClientGateway(ClientGatewayConfiguration clientGatewayConfiguration)
Create a new instance of ClientGateway |
|
| Method Summary | |
|---|---|
ClientGatewayConfiguration |
getClientGatewayConfiguration()
Return the configuration for this ClientGateway. |
MessageRouter |
getMessageRouter()
Return the MessageRouter for this ClientGateway. |
static void |
main(java.lang.String[] args)
main() For testing and sandboxing. |
EAIMessage |
sendEAIMessage(EAIMessage eaiMessage)
Send an EAIMessage through a configured MessagePipeline. |
EAIMessage |
sendEAIMessage(EAIMessage eaiMessage,
java.lang.String username,
java.lang.String password)
Send an EAIMessage through a configured MessagePipeline with optional UsernameToken credentials. |
EAIMessage |
sendXMLMessage(java.lang.String xmlMessageText)
Send a XML message through a configured MessagePipeline. |
EAIMessage |
sendXMLMessage(java.lang.String xmlMessageText,
AttachmentDescriptor[] attachmentDescriptors)
Send a XML message and attachments through a configured MessagePipeline. |
EAIMessage |
sendXMLMessage(java.lang.String xmlMessageText,
AttachmentDescriptor[] attachmentDescriptors,
java.lang.String username,
java.lang.String password)
Send a XML message and attachments through a configured MessagePipeline with optional UsernameToken credentials. |
EAIMessage |
sendXMLMessage(java.lang.String xmlMessageText,
java.lang.String username,
java.lang.String password)
Send a XML message through a configured MessagePipeline with optional UsernameToken credentials. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static org.apache.commons.logging.Log log
protected java.lang.String thisClassName
protected ClientGatewayConfiguration clientGatewayConfiguration
protected MessageRouter messageRouter
| Constructor Detail |
|---|
public ClientGateway(ClientGatewayConfiguration clientGatewayConfiguration)
throws java.lang.Exception
clientGatewayConfiguration - The ClientGatewayConfiguration
object to use for this gateway.
java.lang.Exception - if there are problems instantiating a
ClientGateway.| Method Detail |
|---|
public EAIMessage sendXMLMessage(java.lang.String xmlMessageText)
throws PipelineStageException,
java.lang.Exception
xmlMessageText - The XML text of the message to send.
PipelineStageException - A PipelineStageException thrown by a MessagePipeline
configured for this gateway, which could mean the
message did not reach osESB or there was a
problem processing a reply from osESB.
java.lang.Exception - Most likely, this is an Exception thrown by the MessageRouter.
For example a messageType could not be extracted from xmlMessageText
or a MessagePipeline that is mapped to the messageType is not
configured.
public EAIMessage sendXMLMessage(java.lang.String xmlMessageText,
java.lang.String username,
java.lang.String password)
throws PipelineStageException,
java.lang.Exception
xmlMessageText - The XML text of the message to send.username - The username for the UsernameToken credential.password - The optional password for the UsernameToken credential.
PipelineStageException - A PipelineStageException thrown by a MessagePipeline
configured for this gateway, which could mean the
message did not reach osESB or there was a
problem processing a reply from osESB.
java.lang.Exception - Most likely, this is an Exception thrown by the MessageRouter.
For example a messageType could not be extracted from xmlMessageText
or a MessagePipeline that is mapped to the messageType is not
configured.
public EAIMessage sendXMLMessage(java.lang.String xmlMessageText,
AttachmentDescriptor[] attachmentDescriptors)
throws PipelineStageException,
java.lang.Exception
xmlMessageText - The XML text of the message to send.attachmentDescriptors - An array of AttachmentDescriptor(s).
PipelineStageException - A PipelineStageException thrown by a MessagePipeline
configured for this gateway, which could mean the
message did not reach osESB or there was a
problem processing a reply from osESB.
java.lang.Exception - Most likely, this is an Exception thrown by the MessageRouter.
For example a messageType could not be extracted from xmlMessageText
or a MessagePipeline that is mapped to the messageType is not
configured.
public EAIMessage sendXMLMessage(java.lang.String xmlMessageText,
AttachmentDescriptor[] attachmentDescriptors,
java.lang.String username,
java.lang.String password)
throws PipelineStageException,
java.lang.Exception
xmlMessageText - The XML text of the message to send.attachmentDescriptors - An array of AttachmentDescriptor(s).username - The username for the UsernameToken credential.password - The optional password for the UsernameToken credential.
PipelineStageException - A PipelineStageException thrown by a MessagePipeline
configured for this gateway, which could mean the
message did not reach osESB or there was a
problem processing a reply from osESB.
java.lang.Exception - Most likely, this is an Exception thrown by the MessageRouter.
For example a messageType could not be extracted from xmlMessageText
or a MessagePipeline that is mapped to the messageType is not
configured.
public EAIMessage sendEAIMessage(EAIMessage eaiMessage)
throws PipelineStageException,
java.lang.Exception
eaiMessage - The EAIMessage to send.
PipelineStageException - A PipelineStageException thrown by a MessagePipeline
configured for this gateway, which could mean the
message did not reach osESB or there was a
problem processing a reply from osESB.
java.lang.Exception - Most likely, this is an Exception thrown by the MessageRouter.
For example a messageType could not be extracted from xmlMessageText
or a MessagePipeline that is mapped to the messageType is not
configured.
public EAIMessage sendEAIMessage(EAIMessage eaiMessage,
java.lang.String username,
java.lang.String password)
throws PipelineStageException,
java.lang.Exception
eaiMessage - The EAIMessage to send.username - The username for the UsernameToken credential.password - The optional password for the UsernameToken credential.
PipelineStageException - A PipelineStageException thrown by a MessagePipeline
configured for this gateway, which could mean the
message did not reach osESB or there was a
problem processing a reply from osESB.
java.lang.Exception - Most likely, this is an Exception thrown by the MessageRouter.
For example a messageType could not be extracted from xmlMessageText
or a MessagePipeline that is mapped to the messageType is not
configured.public ClientGatewayConfiguration getClientGatewayConfiguration()
public MessageRouter getMessageRouter()
public 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 | ||||||||