examples.jms.messageformat
Class ClientReceive
java.lang.Object
|
+--examples.jms.messageformat.ClientReceive
- public class ClientReceive
- extends java.lang.Object
This class shows how to establish a connection to and receive messages from
a JMS queue.
Run this class after you have run the ClientSend class to send XML
data to a JMS queue. After ClientSend has sent its message, the Message-
driven EJB MessageTraderBean retrieves the XML data from the
queue, parses it, then sends the output to another JMS queue. This class,
ClientReceive, gets the final message from this JMS queue.
- Author:
- Copyright (c) 2002 by BEA Systems, Inc. All Rights Reserved.
|
Method Summary |
java.lang.String |
getXmlMessage()
|
static void |
main(java.lang.String[] args)
Runs this example from the command line. |
void |
receive(java.lang.String url)
Establishes a connection to the JMS queue and receives the
trade result in the form of XML data. |
| Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JMS_FACTORY
public static final java.lang.String JMS_FACTORY
JNDI_FACTORY
public static final java.lang.String JNDI_FACTORY
QUEUE
public static final java.lang.String QUEUE
ClientReceive
public ClientReceive()
getXmlMessage
public java.lang.String getXmlMessage()
main
public static void main(java.lang.String[] args)
throws java.lang.Exception
- Runs this example from the command line.
Use this command:
java examples.jms.messageformat.ClientReceive t3://localhost:7001
receive
public void receive(java.lang.String url)
throws javax.naming.NamingException,
javax.jms.JMSException,
java.io.IOException,
javax.xml.parsers.ParserConfigurationException,
org.xml.sax.SAXException
- Establishes a connection to the JMS queue and receives the
trade result in the form of XML data.
- Throws:
javax.naming.NamingException - if a JNDI naming exception occurredjavax.jms.JMSException - if a JMS exception occurredjava.io.IOException - if an IO naming exception occurredjavax.xml.parsers.ParserConfigurationException - if a parser configuration exception occurredorg.xml.sax.SAXException - if a SAX exception occurred
Copyright © 2002 BEA Systems, Inc. All Rights Reserved.