List of all members.
Detailed Description
Public interface. Provide methods to create and publish messages on topics. The standard JMS specified message types are supported :
Two kinds of exception are thrown :
-
javax.jms.JMSException are thrown for exceptions caused by a problem in the underlying implementation.
-
javax.naming.NamingException are thrown if the topic usage is not correct. Each time a topic is used, either in publication or in subscription, the topic name is checked against the topic namespace, to avoid namespace pollution and performance degradation
This example shows a simple publication of a TextMessage on a topic:
<blockquote>
try {
Publisher p = PubSubFactory.publisher();
} catch (MOMException momEx) { ... }
// ...
try {
TextMessage msg = p.createTextMessage();
msg.setText("This is the text");
p.publish("CMW.DEVICES.PowerConverter.PC1.Current", msg);
// ...
p.close();
}
catch (JMSException jmsEx) { ... }
catch (NamingException namingEx) { ... }
</blockquote>
- Version:
- 1.0 23 Jan 2001
- Author:
- Controls Middleware Project
- See also:
- PubSubFactory
-
Subscriber
-
cern.cmw.mom.mapping.MappingService
Member Function Documentation
void cern.cmw.mom.pubsub.Publisher.close |
( |
|
) |
|
BytesMessage cern.cmw.mom.pubsub.Publisher.createBytesMessage |
( |
|
) |
throws JMSException |
Create an instance of BytesMessage.
- Exceptions:
-
| JMSException | if JMS fails to create the message due to some internal JMS error. |
- Returns:
- BytesMessage the BytesMessage instance
MapMessage cern.cmw.mom.pubsub.Publisher.createMapMessage |
( |
|
) |
throws JMSException |
Create an instance of MapMessage.
- Exceptions:
-
| JMSException | if JMS fails to create the message due to some internal JMS error. |
- Returns:
- MapMessage the MapMessage instance
Message cern.cmw.mom.pubsub.Publisher.createMessage |
( |
|
) |
throws JMSException |
Create an instance of Message.
- Exceptions:
-
| JMSException | if JMS fails to create the message due to some internal JMS error. |
- Returns:
- Message the Message instance
ObjectMessage cern.cmw.mom.pubsub.Publisher.createObjectMessage |
( |
|
) |
throws JMSException |
Create an instance of ObjectMessage.
- Exceptions:
-
| JMSException | if JMS fails to create the message due to some internal JMS error. |
- Returns:
- ObjectMessage the ObjectMessage instance
StreamMessage cern.cmw.mom.pubsub.Publisher.createStreamMessage |
( |
|
) |
throws JMSException |
Create an instance of StreamMessage.
- Exceptions:
-
| JMSException | if JMS fails to create the message due to some internal JMS error. |
- Returns:
- StreamMessage the StreamMessage instance
TextMessage cern.cmw.mom.pubsub.Publisher.createTextMessage |
( |
|
) |
throws JMSException |
Create an instance of TextMessage.
- Exceptions:
-
| JMSException | if JMS fails to create the message due to some internal JMS error. |
- Returns:
- TextMessage the TextMessage instance
void cern.cmw.mom.pubsub.Publisher.publish |
( |
String |
topic, |
|
|
Message |
message | |
|
) |
| | throws JMSException, NamingException |
Publish a message to the given topic.
- Parameters:
-
| topic | The String representation of the topic |
| message | The Message object to publish |
- Exceptions:
-
| JMSException | if JMS fails to publish the message due to some internal JMS error. |
| NamingException | if there is a violation in the namespace policy. |
void cern.cmw.mom.pubsub.Publisher.publish |
( |
String |
topic, |
|
|
Message |
message, |
|
|
int |
deliveryMode, |
|
|
int |
priority, |
|
|
long |
timeToLive | |
|
) |
| | throws JMSException, NamingException |
Publish a message to the given topic.
- Parameters:
-
| topic | The String representation of the topic |
| message | The Message object to publish |
| deliveryMode | The Message persistence (true, false) |
| priority | The Message priority (0..9) |
| timeToLive | The Message time to live (msec) |
- Exceptions:
-
| JMSException | if JMS fails to publish the message due to some internal JMS error. |
| NamingException | if there is a violation in the namespace policy. |
void cern.cmw.mom.pubsub.Publisher.setExceptionListener |
( |
ExceptionListener |
listener |
) |
|
The documentation for this interface was generated from the following file: