org.jboss.mq
Class SpyTopicPublisher

java.lang.Object
  extended byorg.jboss.mq.SpyMessageProducer (src) 
      extended byorg.jboss.mq.SpyTopicPublisher
All Implemented Interfaces:
MessageProducer (src) , TopicPublisher (src)

public class SpyTopicPublisher
extends SpyMessageProducer (src)
implements TopicPublisher (src)

This class implements javax.jms.TopicPublisher A publisher created with a null Topic will now be interpreted as created as an unidentifyed publisher and follows the spec in throwing UnsupportedOperationException at the correct places.


Field Summary
 
Fields inherited from class org.jboss.mq.SpyMessageProducer (src)
closed, defaultDeliveryMode, defaultPriority, defaultTTL, destination, session
 
Method Summary
 Topic (src) getTopic()
          Gets the topic associated with this TopicPublisher.
 void publish(Message (src)  message)
          Publishes a message to the topic.
 void publish(Message (src)  message, int deliveryMode, int priority, long timeToLive)
          Publishes a message to the topic, specifying delivery mode, priority, and time to live.
 void publish(Topic (src)  topic, Message (src)  message)
          Publishes a message to a topic for an unidentified message producer.
 void publish(Topic (src)  topic, Message (src)  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 org.jboss.mq.SpyMessageProducer (src)
checkClosed, close, encapsulateMessage, getDeliveryMode, getDestination, getDisableMessageID, getDisableMessageTimestamp, getPriority, getTimeToLive, send, send, send, send, setDeliveryMode, setDisableMessageID, setDisableMessageTimestamp, setPriority, setTimeToLive, setTimeToLive, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.jms.MessageProducer (src)
close, getDeliveryMode, getDestination, getDisableMessageID, getDisableMessageTimestamp, getPriority, getTimeToLive, send, send, send, send, setDeliveryMode, setDisableMessageID, setDisableMessageTimestamp, setPriority, setTimeToLive
 

Method Detail

getTopic

public Topic (src)  getTopic()
               throws JMSException (src) 
Description copied from interface: TopicPublisher (src)
Gets the topic associated with this TopicPublisher.

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

publish

public void publish(Message (src)  message)
             throws JMSException (src) 
Description copied from interface: TopicPublisher (src)
Publishes a message to the topic. Uses the TopicPublisher's default delivery mode, priority, and time to live.

Specified by:
publish in interface TopicPublisher (src)
Parameters:
message - the message to publish
Throws:
JMSException (src) - if the JMS provider fails to publish the message due to some internal error.
See Also:
MessageProducer.getDeliveryMode(), MessageProducer.getTimeToLive(), MessageProducer.getPriority()

publish

public void publish(Message (src)  message,
                    int deliveryMode,
                    int priority,
                    long timeToLive)
             throws JMSException (src) 
Description copied from interface: TopicPublisher (src)
Publishes a message to the topic, specifying delivery mode, priority, and time to live.

Specified by:
publish in interface TopicPublisher (src)
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:
JMSException (src) - if the JMS provider fails to publish the message due to some internal error.

publish

public void publish(Topic (src)  topic,
                    Message (src)  message)
             throws JMSException (src) 
Description copied from interface: TopicPublisher (src)
Publishes a message to a topic for an unidentified message producer. Uses the TopicPublisher's default delivery mode, priority, and time to live.

Typically, a message producer is assigned a topic at creation time; however, the JMS API also supports unidentified message producers, which require that the topic be supplied every time a message is published.

Specified by:
publish in interface TopicPublisher (src)
Parameters:
topic - the topic to publish this message to
message - the message to publish
Throws:
JMSException (src) - if the JMS provider fails to publish the message due to some internal error.
See Also:
MessageProducer.getDeliveryMode(), MessageProducer.getTimeToLive(), MessageProducer.getPriority()

publish

public void publish(Topic (src)  topic,
                    Message (src)  message,
                    int deliveryMode,
                    int priority,
                    long timeToLive)
             throws JMSException (src) 
Description copied from interface: TopicPublisher (src)
Publishes a message to a topic for an unidentified message producer, specifying delivery mode, priority and time to live.

Typically, a message producer is assigned a topic at creation time; however, the JMS API also supports unidentified message producers, which require that the topic be supplied every time a message is published.

Specified by:
publish in interface TopicPublisher (src)
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:
JMSException (src) - if the JMS provider fails to publish the message due to some internal error.