public class TopicPublisher extends MessageProducer implements TopicPublisher
javax.jms.TopicPublisher
interface.closed, dest, sess
Constructor and Description |
---|
TopicPublisher(TopicSession sess,
Destination topic)
Constructs a publisher.
|
Modifier and Type | Method and Description |
---|---|
Topic |
getTopic()
API method.
|
void |
publish(Message message)
API method.
|
void |
publish(Message message,
int deliveryMode,
int priority,
long timeToLive)
API method.
|
void |
publish(Topic topic,
Message message)
API method.
|
void |
publish(Topic topic,
Message message,
int deliveryMode,
int priority,
long timeToLive)
API method.
|
String |
toString()
Returns a string view of this receiver.
|
close, getDeliveryDelay, getDeliveryMode, getDestination, getDisableMessageID, getDisableMessageTimestamp, getPriority, getTimeToLive, send, send, send, send, send, send, send, send, setDeliveryDelay, setDeliveryMode, setDisableMessageID, setDisableMessageTimestamp, setPriority, setTimeToLive
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
close, getDeliveryMode, getDestination, getDisableMessageID, getDisableMessageTimestamp, getPriority, getTimeToLive, send, send, send, send, setDeliveryMode, setDisableMessageID, setDisableMessageTimestamp, setPriority, setTimeToLive
TopicPublisher(TopicSession sess, Destination topic) throws JMSException
sess
- The session the publisher belongs to.topic
- The topic the publisher publishs messages on.IllegalStateException
- If the connection is broken.JMSException
- If the creation fails for any other reason.public String toString()
public Topic getTopic() throws JMSException
getTopic
in interface TopicPublisher
IllegalStateException
- If the publisher is closed.JMSException
public void publish(Message message, int deliveryMode, int priority, long timeToLive) throws JMSException
publish
in interface TopicPublisher
message
- the message to send.deliveryMode
- the delivery mode to use.priority
- the priority for this message.timeToLive
- the message's lifetime in milliseconds.IllegalStateException
- If the publisher is closed, or if the
connection is broken.JMSException
- If the request fails for any other reason.public void publish(Message message) throws JMSException
publish
in interface TopicPublisher
message
- the message to send.IllegalStateException
- If the publisher is closed, or if the
connection is broken.JMSException
- If the request fails for any other reason.public void publish(Topic topic, Message message) throws JMSException
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.
publish
in interface TopicPublisher
topic
- the topic to send this message to.message
- the message to send.IllegalStateException
- If the publisher is closed, or if the
connection is broken.JMSException
- If the request fails for any other reason.public void publish(Topic topic, Message message, int deliveryMode, int priority, long timeToLive) throws JMSException
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.
publish
in interface TopicPublisher
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.IllegalStateException
- If the publisher is closed, or if the
connection is broken.JMSException
- If the request fails for any other reason.Copyright © 2022 ScalAgent D.T.. All rights reserved.