Package org.objectweb.joram.client.jms
Class TopicPublisher
- java.lang.Object
-
- org.objectweb.joram.client.jms.MessageProducer
-
- org.objectweb.joram.client.jms.TopicPublisher
-
- All Implemented Interfaces:
AutoCloseable,MessageProducer,TopicPublisher
public class TopicPublisher extends MessageProducer implements TopicPublisher
Implements thejavax.jms.TopicPublisherinterface.
-
-
Field Summary
-
Fields inherited from class org.objectweb.joram.client.jms.MessageProducer
closed, dest, sess
-
-
Constructor Summary
Constructors Constructor Description TopicPublisher(TopicSession sess, Destination topic)Constructs a publisher.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TopicgetTopic()API method.voidpublish(Message message)API method.voidpublish(Message message, int deliveryMode, int priority, long timeToLive)API method.voidpublish(Topic topic, Message message)API method.voidpublish(Topic topic, Message message, int deliveryMode, int priority, long timeToLive)API method.StringtoString()Returns a string view of this receiver.-
Methods inherited from class org.objectweb.joram.client.jms.MessageProducer
close, getDeliveryDelay, getDeliveryMode, getDestination, getDisableMessageID, getDisableMessageTimestamp, getPriority, getTimeToLive, send, send, send, send, send, send, send, send, setDeliveryDelay, setDeliveryMode, setDisableMessageID, setDisableMessageTimestamp, setPriority, setTimeToLive
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface javax.jms.MessageProducer
close, getDeliveryDelay, getDeliveryMode, getDestination, getDisableMessageID, getDisableMessageTimestamp, getPriority, getTimeToLive, send, send, send, send, send, send, send, send, setDeliveryDelay, setDeliveryMode, setDisableMessageID, setDisableMessageTimestamp, setPriority, setTimeToLive
-
-
-
-
Constructor Detail
-
TopicPublisher
TopicPublisher(TopicSession sess, Destination topic) throws JMSException
Constructs a publisher.- Parameters:
sess- The session the publisher belongs to.topic- The topic the publisher publishs messages on.- Throws:
IllegalStateException- If the connection is broken.JMSException- If the creation fails for any other reason.
-
-
Method Detail
-
toString
public String toString()
Returns a string view of this receiver.
-
getTopic
public Topic getTopic() throws JMSException
API method. Gets the topic associated with this topic publisher.- Specified by:
getTopicin interfaceTopicPublisher- Returns:
- this publisher's topic.
- Throws:
IllegalStateException- If the publisher is closed.JMSException
-
publish
public void publish(Message message, int deliveryMode, int priority, long timeToLive) throws JMSException
API method. Sends a message to a topic with default delivery parameters.- Specified by:
publishin interfaceTopicPublisher- Parameters:
message- the message to send.deliveryMode- the delivery mode to use.priority- the priority for this message.timeToLive- the message's lifetime in milliseconds.- Throws:
IllegalStateException- If the publisher is closed, or if the connection is broken.JMSException- If the request fails for any other reason.
-
publish
public void publish(Message message) throws JMSException
API method. Sends a message to a topic with default delivery parameters.- Specified by:
publishin interfaceTopicPublisher- Parameters:
message- the message to send.- Throws:
IllegalStateException- If the publisher is closed, or if the connection is broken.JMSException- If the request fails for any other reason.
-
publish
public void publish(Topic topic, Message message) throws JMSException
API method. Sends a message to a topic for an unidentified topic publisher with default delivery parameters.Typically, a topic publisher is assigned a topic at creation time; however, the JMS API also supports unidentified topic publisher, which require that the topic be supplied every time a message is sent.
- Specified by:
publishin interfaceTopicPublisher- Parameters:
topic- the topic to send this message to.message- the message to send.- Throws:
IllegalStateException- If the publisher is closed, or if the connection is broken.JMSException- If the request fails for any other reason.
-
publish
public void publish(Topic topic, Message message, int deliveryMode, int priority, long timeToLive) throws JMSException
API method. Sends a message to a topic for an unidentified topic publisher with given delivery parameters.Typically, a topic publisher is assigned a topic at creation time; however, the JMS API also supports unidentified topic publisher, which require that the topic be supplied every time a message is sent.
- Specified by:
publishin interfaceTopicPublisher- Parameters:
topic- the topic to send this message to.message- the message to send.deliveryMode- the delivery mode to use.priority- the priority for this message.timeToLive- the message's lifetime in milliseconds.- Throws:
IllegalStateException- If the publisher is closed, or if the connection is broken.JMSException- If the request fails for any other reason.
-
-