
Public Member Functions | |
| void | setExceptionListener (ExceptionListener listener) |
| void | close () |
| long | subscribe (String topic, SubscriptionListener listener, String selector) throws JMSException, NamingException |
| void | unSubscribe (long subscriptionToken) throws JMSException |
| void | unSubscribeAll () throws JMSException |
Two kinds of exception are thrown :
This example shows a simple subscription to a topic:
<blockquote>
try {
s = PubSubFactory.subscriber();
} catch (MOMException momEx) { ... }
try {
subToken = s.subscribe("CMW.DEVICES.PowerConverter.PC1.Current", listener, selector);
// ...
s.unSubscribe(subToken);
s.close();
}
catch (JMSException jmsEx) { ... }
catch (NamingException namingEx) { ... }
</blockquote> where listener is an instance of a class implementing the SubscriptionListener interface method void onMessage(Message m) and selector is an optional String defining a message selector.
|
|
Close the publisher singleton instance and dealloacate any resource. Implemented in cern::cmw::mom::pubsub::impl::DefaultSubscriberImpl.
|
|
|
Set the listener for exceptions handling
|
|
||||||||||||||||
|
Subscribe to the given topic.
Implemented in cern::cmw::mom::pubsub::impl::DefaultSubscriberImpl.
|
|
|
Close the subscription identified by the subscriptionToken.
Implemented in cern::cmw::mom::pubsub::impl::DefaultSubscriberImpl.
|
|
|
Close all the opened subscriptions.
Implemented in cern::cmw::mom::pubsub::impl::DefaultSubscriberImpl.
|
1.3.8