

Public Member Functions | |
| PropertySubscription () | |
| void | subscribeToProperty () |
| void | onMessage (javax.jms.Message message) |
Static Public Member Functions | |
| static void | main (String[] args) |
Private Attributes | |
| Subscriber | sub = null |
| long | subscriptionToken = 0 |
Static Private Attributes | |
| static final String | DEV_CLASS = "PowerConverter" |
| static final String | DEV_INSTANCE = "PC1" |
| static final String | DEV_PROPERTY = "Current" |
| static final String | CYCLE_SELECTOR = "Cycle_X" |
This example shows how to subscribe to a device property through the pubsub API.
<blockquote>
public void subscribeToProperty() { String topic = MappingService.mapPropertyToTopic(DEV_CLASS, DEV_INSTANCE, DEV_PROPERTY); String cycle_selector = MappingService.mapCycleSelectorToSelector(CYCLE_SELECTOR); try { subscriptionToken = sub.subscribe( topic, this, cycle_selector); } catch(javax.jms.JMSException je) { je.printStackTrace(); } catch (javax.naming.NamingException ne) { ne.printStackTrace(); } }
</blockquote>
| cern::cmw::mom::test::PropertySubscription::PropertySubscription | ( | ) | [inline] |
| static void cern::cmw::mom::test::PropertySubscription::main | ( | String[] | args | ) | [inline, static] |
| void cern::cmw::mom::test::PropertySubscription::onMessage | ( | javax.jms.Message | message | ) | [inline] |
Method onMessage
| message |
References cern::cmw::mom::pubsub::Subscriber::close(), sub, subscriptionToken, and cern::cmw::mom::pubsub::Subscriber::unSubscribe().
| void cern::cmw::mom::test::PropertySubscription::subscribeToProperty | ( | ) | [inline] |
Method subscribeToProperty
References CYCLE_SELECTOR, DEV_CLASS, DEV_INSTANCE, DEV_PROPERTY, sub, cern::cmw::mom::pubsub::Subscriber::subscribe(), and subscriptionToken.
Referenced by PropertySubscription().
final String cern::cmw::mom::test::PropertySubscription::CYCLE_SELECTOR = "Cycle_X" [static, private] |
Referenced by subscribeToProperty().
final String cern::cmw::mom::test::PropertySubscription::DEV_CLASS = "PowerConverter" [static, private] |
Referenced by subscribeToProperty().
final String cern::cmw::mom::test::PropertySubscription::DEV_INSTANCE = "PC1" [static, private] |
Referenced by subscribeToProperty().
final String cern::cmw::mom::test::PropertySubscription::DEV_PROPERTY = "Current" [static, private] |
Referenced by subscribeToProperty().
Subscriber cern::cmw::mom::test::PropertySubscription::sub = null [private] |
Referenced by onMessage(), PropertySubscription(), and subscribeToProperty().
long cern::cmw::mom::test::PropertySubscription::subscriptionToken = 0 [private] |
Referenced by onMessage(), and subscribeToProperty().
1.6.2