    All Examples  This Package  JMS Examples

# Class examples.jms.topic.TopicSend

    examples.jms.topic.TopicSend

public class TopicSend

The classes in this package work together to show how to establish a connection to a JMS Topic and receive messages from a Topic. This class is used to send messages to the Topic.

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

##

JMS_FACTORY
JNDI_FACTORY
msg
tcon
tconFactory
topic
TOPIC
tpublisher
tsession

##

TopicSend()

##

close()
  Close JMS objects.
getInitialContext(String)
init(Context, String)
  Create all the necessary objects for sending messages to a JMS Topic.
main(String[])
readAndSend(TopicSend)
send(String)
  Send a message to a JMS Topic.

##

JNDI_FACTORY

     public static final String JNDI_FACTORY

JMS_FACTORY

     public static final String JMS_FACTORY

TOPIC

     public static final String TOPIC

tconFactory

     protected TopicConnectionFactory tconFactory

tcon

     protected TopicConnection tcon

tsession

     protected TopicSession tsession

tpublisher

     protected TopicPublisher tpublisher

topic

     protected Topic topic

msg

     protected TextMessage msg

##

TopicSend

     public TopicSend()

##

init

     public void init(Context ctx,
                      String topicName) throws NamingException, JMSException

  Create all the necessary objects for sending messages to a JMS Topic.

send

     public void send(String message) throws JMSException

  Send a message to a JMS Topic.

close

     public void close() throws JMSException

  Close JMS objects.

main

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

readAndSend

     protected static void readAndSend(TopicSend ts) throws IOException, JMSException

getInitialContext

     protected static InitialContext getInitialContext(String url) throws NamingException

    All Examples  This Package  JMS Examples