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.
-
JMS_FACTORY
-
-
JNDI_FACTORY
-
-
PARSER
-
-
QUEUE
-
-
Client()
-
-
close()
- Close JMS objects.
-
init(Context, String, String)
- Create all the necessary objects for sending and receiving
messages from a JMS queue.
-
main(String[])
- Runs this example from the command line.
-
onMessage(Message)
- Called when a message is received from the JMS message queue.
-
send(String, String, String)
- Send a message in the form of XML data to a JMS queue.
JNDI_FACTORY
public static final String JNDI_FACTORY
JMS_FACTORY
public static final String JMS_FACTORY
QUEUE
public static final String QUEUE
PARSER
public static final String PARSER
Client
public Client()
onMessage
public void onMessage(Message message)
- Called when a message is received from the JMS message queue. (MessageListener interface)
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.
close
public void close() throws JMSException
- Close JMS objects.
main
public static void main(String args[]) throws Exception
- Runs this example from the command line.
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