cgl.narada.jms
Class JmsTopicPublisher

java.lang.Object
  extended by cgl.narada.jms.JmsMessageProducer
      extended by cgl.narada.jms.JmsTopicPublisher
All Implemented Interfaces:
JmsDebugFlags, MessageProducer, TopicPublisher

public class JmsTopicPublisher
extends JmsMessageProducer
implements TopicPublisher, JmsDebugFlags

A client uses a TopicPublisher object to publish messages on a topic. A TopicPublisher object is the publish-subscribe form of a message producer. Normally, the Topic is specified when a TopicPublisher is created. In this case, an attempt to use the publish methods for an unidentified TopicPublisher will throw a java.lang.UnsupportedOperationException .

If the TopicPublisher is created with an unidentified Topic, an attempt to use the publish methods that assume that the Topic has been identified will throw a java.lang.UnsupportedOperationException.

The following message headers are set as part of publishing a message: JMSDestination, JMSDeliveryMode, JMSExpiration, JMSPriority, JMSMessageID and JMSTimeStamp.


Field Summary
 
Fields inherited from interface cgl.narada.jms.JmsDebugFlags
JmsConnection_Debug, JmsDestination_Debug, JmsHeader_Debug, JmsLogger_Debug, JmsMessage_Debug, JmsObjectMessage_Debug, JmsProperties_Debug, JmsTextMessage_Debug, JmsTopic_Debug, JmsTopicAndSelectorVerifier_Debug, JmsTopicConnection_Debug, JmsTopicConnectionFactory_Debug, JmsTopicPublisher_Debug, JmsTopicSession_Debug, JmsTopicSubscriber_Debug
 
Constructor Summary
JmsTopicPublisher(JmsTopicSession jmsTopicSession, Topic topic)
          Created in JmsTopicSession
 
Method Summary
 Topic getTopic()
          Gets the topic associated with this TopicPublisher.
 void publish(Message message)
           
 void publish(Message message, int deliveryMode, int priority, long timeToLive)
           
 void publish(Topic newTopic, Message message)
           
 void publish(Topic newTopic, Message message, int deliveryMode, int priority, long timeToLive)
           
 
Methods inherited from class cgl.narada.jms.JmsMessageProducer
close, getDeliveryMode, getDisableMessageID, getDisableMessageTimestamp, getPriority, getTimeToLive, setDeliveryMode, setDisableMessageID, setDisableMessageTimestamp, setPriority, setTimeToLive
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.jms.MessageProducer
close, getDeliveryMode, getDisableMessageID, getDisableMessageTimestamp, getPriority, getTimeToLive, setDeliveryMode, setDisableMessageID, setDisableMessageTimestamp, setPriority, setTimeToLive
 

Constructor Detail

JmsTopicPublisher

public JmsTopicPublisher(JmsTopicSession jmsTopicSession,
                         Topic topic)
Created in JmsTopicSession

Method Detail

getTopic

public Topic getTopic()
               throws JMSException
Gets the topic associated with this TopicPublisher.

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

publish

public void publish(Message message)
             throws JMSException
Specified by:
publish in interface TopicPublisher
Throws:
JMSException

publish

public void publish(Message message,
                    int deliveryMode,
                    int priority,
                    long timeToLive)
             throws JMSException
Specified by:
publish in interface TopicPublisher
Throws:
JMSException

publish

public void publish(Topic newTopic,
                    Message message)
             throws JMSException
Specified by:
publish in interface TopicPublisher
Throws:
JMSException

publish

public void publish(Topic newTopic,
                    Message message,
                    int deliveryMode,
                    int priority,
                    long timeToLive)
             throws JMSException
Specified by:
publish in interface TopicPublisher
Throws:
JMSException


For comments and suggestions please send e-mail to The NaradaBrokering Project