WebLogic Server 7.0 Code Examples, BEA Systems, Inc.

examples.jms.messageformat
Class ClientSend

java.lang.Object
  |
  +--examples.jms.messageformat.ClientSend

public class ClientSend
extends java.lang.Object

This class asks the user to input data to define a stock trade transaction. The class generates XML data from the user input and sends the data to the JMS queue. A Message-driven bean then reads the request from the queue and parses it using a SAX compliant parser.

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

Field Summary
static java.lang.StringBuffer buffer
           
static java.lang.String JMS_FACTORY
           
static java.lang.String JNDI_FACTORY
           
static java.lang.String QUEUE
           
 
Constructor Summary
ClientSend()
           
 
Method Summary
 void close()
          Closes all JMS objects.
 void init(javax.naming.Context ctx, java.lang.String queueName)
          Creates all the necessary objects for sending messages to a JMS queue.
static void main(java.lang.String[] args)
          Runs this client from the command line.
 void send(java.lang.String message)
          Sends a message in the form of XML data to a JMS queue.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

buffer

public static final java.lang.StringBuffer buffer

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

ClientSend

public ClientSend()
Method Detail

close

public void close()
           throws javax.jms.JMSException
Closes all JMS objects.
Throws:
javax.jms.JMSException - if a JMS error occurred

init

public void init(javax.naming.Context ctx,
                 java.lang.String queueName)
          throws javax.naming.NamingException,
                 javax.jms.JMSException
Creates all the necessary objects for sending messages to a JMS queue.
Parameters:
ctx - the initial context
queueName - the name of the JMS queue
Throws:
javax.naming.NamingException - if a naming exception occurred
javax.jms.JMSException - if a JMS exception occurred

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Runs this client from the command line.

Use the following command: java examples.jms.messageformat.ClientSend t3://localhost:7001


send

public void send(java.lang.String message)
          throws javax.jms.JMSException
Sends a message in the form of XML data to a JMS queue.
Throws:
javax.jms.JMSException - if a JMS error occurred

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

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