
Public Member Functions | |
| void | setExceptionListener (ExceptionListener listener) |
| void | close () |
| BytesMessage | createBytesMessage () throws JMSException |
| MapMessage | createMapMessage () throws JMSException |
| Message | createMessage () throws JMSException |
| ObjectMessage | createObjectMessage () throws JMSException |
| StreamMessage | createStreamMessage () throws JMSException |
| TextMessage | createTextMessage () throws JMSException |
| void | publish (String topic, Message message) throws JMSException, NamingException |
| void | publish (String topic, Message message, int deliveryMode, int priority, long timeToLive) throws JMSException, NamingException |
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 :
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>| void cern::cmw::mom::pubsub::Publisher::close | ( | ) |
Close the publisher singleton instance and dealloacate any resource
Implemented in cern::cmw::mom::pubsub::impl::DefaultPublisherImpl.
Referenced by cern::cmw::mom::test::HelloWorld::close(), cern::laser::source::alarmsysteminterface::impl::AlarmSystemInterfaceProxy::close(), cern::cmw::mom::test::chat::ChatClient::disconnect(), cern::cmw::mom::test::Producer::Producer(), cern::cmw::mom::test::Server::start(), and cern::cmw::mom::test::TestPkgSimple::TestPkgSimple().
| BytesMessage cern::cmw::mom::pubsub::Publisher::createBytesMessage | ( | ) | throws JMSException |
Create an instance of BytesMessage.
| JMSException | if JMS fails to create the message due to some internal JMS error. |
Implemented in cern::cmw::mom::pubsub::impl::DefaultPublisherImpl.
| MapMessage cern::cmw::mom::pubsub::Publisher::createMapMessage | ( | ) | throws JMSException |
Create an instance of MapMessage.
| JMSException | if JMS fails to create the message due to some internal JMS error. |
Implemented in cern::cmw::mom::pubsub::impl::DefaultPublisherImpl.
Referenced by cern::cmw::mom::test::HelloWorld::publishToHelloWorld().
| Message cern::cmw::mom::pubsub::Publisher::createMessage | ( | ) | throws JMSException |
Create an instance of Message.
| JMSException | if JMS fails to create the message due to some internal JMS error. |
Implemented in cern::cmw::mom::pubsub::impl::DefaultPublisherImpl.
| ObjectMessage cern::cmw::mom::pubsub::Publisher::createObjectMessage | ( | ) | throws JMSException |
Create an instance of ObjectMessage.
| JMSException | if JMS fails to create the message due to some internal JMS error. |
Implemented in cern::cmw::mom::pubsub::impl::DefaultPublisherImpl.
Referenced by cern::cmw::mom::test::Server::onMessage(), cern::cmw::mom::test::Producer::publish(), and cern::cmw::mom::test::Server::start().
| StreamMessage cern::cmw::mom::pubsub::Publisher::createStreamMessage | ( | ) | throws JMSException |
Create an instance of StreamMessage.
| JMSException | if JMS fails to create the message due to some internal JMS error. |
Implemented in cern::cmw::mom::pubsub::impl::DefaultPublisherImpl.
| TextMessage cern::cmw::mom::pubsub::Publisher::createTextMessage | ( | ) | throws JMSException |
Create an instance of TextMessage.
| JMSException | if JMS fails to create the message due to some internal JMS error. |
Implemented in cern::cmw::mom::pubsub::impl::DefaultPublisherImpl.
Referenced by cern::cmw::mom::test::chat::ChatClient::post(), cern::laser::source::alarmsysteminterface::impl::AlarmSystemInterfaceProxy::publish(), and cern::cmw::mom::test::TestPkgSimple::TestPkgSimple().
| 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.
| 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) |
| JMSException | if JMS fails to publish the message due to some internal JMS error. | |
| NamingException | if there is a violation in the namespace policy. |
Implemented in cern::cmw::mom::pubsub::impl::DefaultPublisherImpl.
| void cern::cmw::mom::pubsub::Publisher::publish | ( | String | topic, | |
| Message | message | |||
| ) | throws JMSException, NamingException |
Publish a message to the given topic.
| topic | The String representation of the topic | |
| message | The Message object to publish |
| JMSException | if JMS fails to publish the message due to some internal JMS error. | |
| NamingException | if there is a violation in the namespace policy. |
Implemented in cern::cmw::mom::pubsub::impl::DefaultPublisherImpl.
Referenced by cern::cmw::mom::test::Server::onMessage(), cern::cmw::mom::test::chat::ChatClient::post(), cern::cmw::mom::test::Producer::publish(), cern::laser::source::alarmsysteminterface::impl::AlarmSystemInterfaceProxy::publish(), cern::cmw::mom::test::HelloWorld::publishToHelloWorld(), cern::cmw::mom::test::Server::start(), and cern::cmw::mom::test::TestPkgSimple::TestPkgSimple().
| void cern::cmw::mom::pubsub::Publisher::setExceptionListener | ( | ExceptionListener | listener | ) |
Set the listener for exceptions handling
| listener | The exceptions listener |
Referenced by cern::laser::source::alarmsysteminterface::impl::AlarmSystemInterfaceProxy::AlarmSystemInterfaceProxy().
1.6.2