All Examples  XML Examples  This Package 

Class examples.xml.jms.Client


java.lang.Object

   |

   +----examples.xml.jms.Client


public class Client
extends Object
implements MessageListener
This example shows how to pass XML data within a JMS message. The classes in this package make up a simple workflow system. This class is used to create a message which requires approval from the AdminClient. The message is combined in the form of XML data with the name of the user who sent the message and the current status of the message. The XML data is sent as a JMS text message to a queue where it awaits approval from the AdminClient. The AdminClient updates attributes of the XML data and returns it to the queue. The message is then read back in by this class which parses the XML data using a SAX compliant parser and displays the results in the console.

Author:
Copyright (c) 2000 by BEA Systems, Inc. All Rights Reserved.

Variable Index

 o JMS_FACTORY
 o JNDI_FACTORY
 o PARSER
 o QUEUE

Constructor Index

 o Client()

Method Index

 o close()
Close JMS objects.
 o init(Context, String, String)
Create all the necessary objects for sending and receiving messages from a JMS queue.
 o main(String[])
Runs this example from the command line.
 o onMessage(Message)
Called when a message is received from the JMS message queue.
 o send(String, String, String)
Send a message in the form of XML data to a JMS queue.

Variables

 o JNDI_FACTORY

 public static final String JNDI_FACTORY

 o JMS_FACTORY

 public static final String JMS_FACTORY

 o QUEUE

 public static final String QUEUE

 o PARSER

 public static final String PARSER

Constructors

 o Client

 public Client()

Methods

 o onMessage

 public void onMessage(Message message)

Called when a message is received from the JMS message queue. (MessageListener interface)

 o init

 public void init(Context ctx,

                  String queueName,

                  String name) throws NamingException, JMSException

Create all the necessary objects for sending and receiving messages from a JMS queue.

 o close

 public void close() throws JMSException

Close JMS objects.

 o main

 public static void main(String args[]) throws Exception

Runs this example from the command line.

 o send

 public void send(String message,

                  String status,

                  String sendTo) throws JMSException

Send a message in the form of XML data to a JMS queue.


All Examples  XML Examples  This Package