|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A client uses a TopicPublisher for publishing messages on a topic. TopicPublisher is the Pub/Sub variant of a JMS message producer.
Normally the Topic is specified when a TopicPublisher is created and in this case, attempting to use the methods for an unidentified TopicPublisher will throws an UnsupportedOperationException.
In the case that the TopicPublisher with an unidentified Topic is created, the methods that assume the Topic has been identified throw an UnsupportedOperationException.
Method Summary | |
Topic |
getTopic()
Get the topic associated with this publisher. |
void |
publish(Message message)
Publish a Message to the topic Use the topics default delivery mode, timeToLive and priority. |
void |
publish(Message message,
int deliveryMode,
int priority,
long timeToLive)
Publish a Message to the topic specifying delivery mode, priority and time to live to the topic. |
void |
publish(Topic topic,
Message message)
Publish a Message to a topic for an unidentified message producer. |
void |
publish(Topic topic,
Message message,
int deliveryMode,
int priority,
long timeToLive)
Publish a Message to a topic for an unidentified message producer, specifying delivery mode, priority and time to live. |
Methods inherited from interface javax.jms.MessageProducer |
close,
getDeliveryMode,
getDisableMessageID,
getDisableMessageTimestamp,
getPriority,
getTimeToLive,
setDeliveryMode,
setDisableMessageID,
setDisableMessageTimestamp,
setPriority,
setTimeToLive |
Method Detail |
public Topic getTopic() throws JMSException
public void publish(Message message) throws JMSException
message
- the message to publishpublic void publish(Message message, int deliveryMode, int priority, long timeToLive) throws JMSException
message
- the message to publishdeliveryMode
- the delivery mode to usepriority
- the priority for this messagetimeToLive
- the message's lifetime (in milliseconds).public void publish(Topic topic, Message message) throws JMSException
Typically a JMS message producer is assigned a topic at creation time; however, JMS also supports unidentified message producers which require that the topic be supplied on every message publish.
topic
- the topic to publish this message tomessage
- the message to sendpublic void publish(Topic topic, Message message, int deliveryMode, int priority, long timeToLive) throws JMSException
Typically a JMS message producer is assigned a topic at creation time; however, JMS also supports unidentified message producers which require that the topic be supplied on every message publish.
topic
- the topic to publish this message tomessage
- the message to senddeliveryMode
- the delivery mode to usepriority
- the priority for this messagetimeToLive
- the message's lifetime (in milliseconds).
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |