com.ibm.mq.jms
Class MQTopicPublisher

java.lang.Object
  |
  +--com.ibm.mq.jms.MQMessageProducer
        |
        +--com.ibm.mq.jms.MQTopicPublisher
All Implemented Interfaces:
javax.jms.MessageProducer, javax.jms.TopicPublisher

public class MQTopicPublisher
extends MQMessageProducer
implements javax.jms.TopicPublisher

A client uses an MQTopicPublisher object to publish messages on a topic. An MQTopicPublisher object is the publish subscribe form of a message producer.


Method Summary
 javax.jms.Topic getTopic()
          Gets the topic associated with this publisher.
 void publish(javax.jms.Message message)
          Publishes a message to the topic.
 void publish(javax.jms.Message message, int deliveryMode, int priority, long timeToLive)
          Publishes a message to the topic, specifying delivery mode, priority, and time to live.
 void publish(javax.jms.Topic topic, javax.jms.Message message)
          Publishes a message to a topic for an unidentified message producer.
 void publish(javax.jms.Topic topic, javax.jms.Message message, int deliveryMode, int priority, long timeToLive)
          Publishes a message to a topic for an unidentified message producer, specifying delivery mode, priority and time to live.
 
Methods inherited from class com.ibm.mq.jms.MQMessageProducer
getDeliveryMode, getDestination, getDisableMessageID, getDisableMessageTimestamp, getPriority, getTimeToLive, send, send, send, send, setDeliveryMode, setDisableMessageID, setDisableMessageTimestamp, setPriority, setTimeToLive
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.jms.MessageProducer
getDeliveryMode, getDestination, getDisableMessageID, getDisableMessageTimestamp, getPriority, getTimeToLive, send, send, send, send, setDeliveryMode, setDisableMessageID, setDisableMessageTimestamp, setPriority, setTimeToLive
 

Method Detail

getTopic

public javax.jms.Topic getTopic()
                         throws javax.jms.JMSException
Gets the topic associated with this publisher.

Specified by:
getTopic in interface javax.jms.TopicPublisher
Returns:
this publisher's topic
Throws:
javax.jms.JMSException - if JMS fails to get topic for this topic publisher due to some internal error.

publish

public void publish(javax.jms.Message message)
             throws javax.jms.JMSException
Publishes a message to the topic. Uses the TopicPublisher’s default delivery mode, priority, and time to live.

Specified by:
publish in interface javax.jms.TopicPublisher
Parameters:
message - the message to publish.
Throws:
javax.jms.JMSException - if publisher fails to publish the message due to an internal error.

publish

public void publish(javax.jms.Message message,
                    int deliveryMode,
                    int priority,
                    long timeToLive)
             throws javax.jms.JMSException
Publishes a message to the topic, specifying delivery mode, priority, and time to live.

Specified by:
publish in interface javax.jms.TopicPublisher
Parameters:
message - the message to publish
deliveryMode - the delivery mode to use
priority - the priority for this message
timeToLive - the message’s lifetime (in milliseconds)
Throws:
javax.jms.JMSException - if publisher fails to publish the message due to an internal error.

publish

public void publish(javax.jms.Topic topic,
                    javax.jms.Message message)
             throws javax.jms.JMSException
Publishes a message to a topic for an unidentified message producer. Uses the TopicPublisher’s default delivery mode, priority, and time to live.

Specified by:
publish in interface javax.jms.TopicPublisher
Parameters:
topic - the topic to publish this message to.
message - - the message to publish.
Throws:
javax.jms.JMSException - if publisher fails to publish the message due to an internal error.

publish

public void publish(javax.jms.Topic topic,
                    javax.jms.Message message,
                    int deliveryMode,
                    int priority,
                    long timeToLive)
             throws javax.jms.JMSException
Publishes a message to a topic for an unidentified message producer, specifying delivery mode, priority and time to live.

Specified by:
publish in interface javax.jms.TopicPublisher
Parameters:
topic - the topic to publish this message to.
message - the message to publish.
deliveryMode - the delivery mode to use.
priority - - the priority for this message.
timeToLive - - the message’s lifetime (in milliseconds).
Throws:
javax.jms.JMSException - if publisher fails to publish the message due to an internal error.

(c) Copyright IBM Corp. 2005. All Rights Reserved.