Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

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  ) 
 

Close the publisher singleton instance and dealloacate any resource.

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

void cern::cmw::mom::pubsub::Subscriber::setExceptionListener ExceptionListener  listener  ) 
 

Set the listener for exceptions handling

Parameters:
listener The exceptions listener

long cern::cmw::mom::pubsub::Subscriber::subscribe String  topic,
SubscriptionListener  listener,
String  selector
throws JMSException, NamingException
 

Subscribe to the given topic.

Parameters:
topic The String representation of the topic
listener An instance of a class implementing the SubscriptionListener interface
selector The String representation of the filter. May be null.
Exceptions:
JMSException if JMS fails to subscribe due to some internal JMS error.
NamingException if there is a violation in the namespace policy.
Returns:
long the unique subscription token.

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

void cern::cmw::mom::pubsub::Subscriber::unSubscribe long  subscriptionToken  )  throws JMSException
 

Close the subscription identified by the subscriptionToken.

Parameters:
subscriptionToken The subscription identifier
Exceptions:
JMSException if JMS fails to unsubscribe due to some internal JMS error.

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

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.


The documentation for this interface was generated from the following file:
Generated on Thu Apr 30 03:07:59 2009 for ACS Java API by doxygen 1.3.8