WebLogic Server 7.0 Code Examples, BEA Systems, Inc.

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.

Field Summary
static java.lang.String JMS_FACTORY
           
static java.lang.String JNDI_FACTORY
           
static java.lang.String QUEUE
           
 
Constructor Summary
ClientReceive()
           
 
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
 

Field Detail

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
Constructor Detail

ClientReceive

public ClientReceive()
Method Detail

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 occurred
javax.jms.JMSException - if a JMS exception occurred
java.io.IOException - if an IO naming exception occurred
javax.xml.parsers.ParserConfigurationException - if a parser configuration exception occurred
org.xml.sax.SAXException - if a SAX exception occurred

Documentation is available at
http://e-docs.bea.com/wls/docs70

Copyright © 2002 BEA Systems, Inc. All Rights Reserved.