cern.cmw.mom.pubsub.SubscriptionListener Interface Reference

Inheritance diagram for cern.cmw.mom.pubsub.SubscriptionListener:
cern.laser.source.alarmsysteminterface.impl.ASISubscriptionListener

Detailed Description

Public interface. The method void onMessage(Message) has to be implemented to handle message reception. The example below shows a possible implementation :

<blockquote>

 class myListener implements SubscriptionListener {
 ...
 public void onMessage(javax.jms.Message message) {
   try {
     javax.jms.TextMessage msg = (javax.jms.TextMessage)message;
     System.out.println("Got message  : " + msg.getText());
     if (msg.getText().equals("bye")) {
       System.out.println("Time to close!");
       exit(0);
     }
   } catch(javax.jms.JMSException je) {
     System.out.println("JMSException raised while processing message: "+message);
     je.printStackTrace();
   }
 }
 ...
 }
 
</blockquote>
Version:
1.0 23 Jan 2001
Author:
Controls Middleware Project

The documentation for this interface was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties