cern::cmw::mom::pubsub::Subscriber Interface Reference

Inheritance diagram for cern::cmw::mom::pubsub::Subscriber:
Inheritance graph
[legend]

List of all members.

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

Detailed Description

Public interface. Provide topic subscription facilities.

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.

See also:
Publisher
SubscriptionListener
PubSubFactory
NotificationHelper
cern.cmw.mom.mapping.MappingService
Version:
1.0 23 Jan 2001
Author:
Controls Middleware Project

Member Function Documentation

void cern::cmw::mom::pubsub::Subscriber::close (  ) 
void cern::cmw::mom::pubsub::Subscriber::setExceptionListener ( ExceptionListener  listener  ) 
long cern::cmw::mom::pubsub::Subscriber::subscribe ( String  topic,
SubscriptionListener  listener,
String  selector 
) throws JMSException, NamingException
void cern::cmw::mom::pubsub::Subscriber::unSubscribe ( long  subscriptionToken  )  throws JMSException
void cern::cmw::mom::pubsub::Subscriber::unSubscribeAll (  )  throws JMSException

Close all the opened subscriptions.

Exceptions:
JMSException if JMS fails to unsubscribe due to some internal JMS error.

Implemented in cern::cmw::mom::pubsub::impl::DefaultSubscriberImpl.

Referenced by cern::laser::client::impl::services::selection::AlarmSelectionHelper::resetSelection(), and cern::laser::client::impl::services::selection::AlarmSearchHelper::resetSelection().


The documentation for this interface was generated from the following file:

Generated by  doxygen 1.6.2