

Public Member Functions | |
| HelloWorld () | |
| void | subscribeToHelloWorld () |
| void | publishToHelloWorld () |
| void | close () |
| void | onMessage (javax.jms.Message m) |
Static Public Member Functions | |
| static void | main (String[] args) |
Private Attributes | |
| Publisher | pub = null |
| Subscriber | sub = null |
| long | subscriptionToken = 0 |
Static Private Attributes | |
| static final String | HELLO_TOPIC = "CMW.TEMP.Hello" |
| static final String | MSG_TXT = "Hello World !!" |
| static final String | TEXT_MAP_FIELD = "TXT" |
| static final String | TIMESTAMP_MAP_FIELD = "TS" |
| static final Category | cat = Category.getInstance(HelloWorld.class.getName()) |
The HelloWorld example. A publisher publishes the message 'Hello World!' to the topic CMW.TEMP.Hello and a subscriber subscribes to it.
| cern::cmw::mom::test::HelloWorld::HelloWorld | ( | ) | [inline] |
Instantiates Publisher & Subscriber, sets up the subscription and publishes the message
References cat, pub, publishToHelloWorld(), sub, and subscribeToHelloWorld().
Referenced by main().
| void cern::cmw::mom::test::HelloWorld::close | ( | ) | [inline] |
Unsubscribes and deallocates both Subscriber & Publisher.
References cat, cern::cmw::mom::pubsub::Publisher::close(), cern::cmw::mom::pubsub::Subscriber::close(), pub, sub, subscriptionToken, and cern::cmw::mom::pubsub::Subscriber::unSubscribe().
Referenced by onMessage().
| static void cern::cmw::mom::test::HelloWorld::main | ( | String[] | args | ) | [inline, static] |
| void cern::cmw::mom::test::HelloWorld::onMessage | ( | javax.jms.Message | m | ) | [inline] |
Method implementing the message handler defined in the SubscriptionListener interface.
| m |
References cat, close(), TEXT_MAP_FIELD, and TIMESTAMP_MAP_FIELD.
| void cern::cmw::mom::test::HelloWorld::publishToHelloWorld | ( | ) | [inline] |
Preapares the message and publishes it.
References cat, cern::cmw::mom::pubsub::Publisher::createMapMessage(), HELLO_TOPIC, MSG_TXT, pub, cern::cmw::mom::pubsub::Publisher::publish(), TEXT_MAP_FIELD, and TIMESTAMP_MAP_FIELD.
Referenced by HelloWorld().
| void cern::cmw::mom::test::HelloWorld::subscribeToHelloWorld | ( | ) | [inline] |
Sets up the subscription.
References cat, HELLO_TOPIC, sub, cern::cmw::mom::pubsub::Subscriber::subscribe(), and subscriptionToken.
Referenced by HelloWorld().
final Category cern::cmw::mom::test::HelloWorld::cat = Category.getInstance(HelloWorld.class.getName()) [static, private] |
Referenced by close(), HelloWorld(), onMessage(), publishToHelloWorld(), and subscribeToHelloWorld().
final String cern::cmw::mom::test::HelloWorld::HELLO_TOPIC = "CMW.TEMP.Hello" [static, private] |
The Topic name.
Referenced by publishToHelloWorld(), and subscribeToHelloWorld().
final String cern::cmw::mom::test::HelloWorld::MSG_TXT = "Hello World !!" [static, private] |
The message text.
Referenced by publishToHelloWorld().
Publisher cern::cmw::mom::test::HelloWorld::pub = null [private] |
The Publisher instance.
Referenced by close(), HelloWorld(), and publishToHelloWorld().
Subscriber cern::cmw::mom::test::HelloWorld::sub = null [private] |
The Subscriber instance.
Referenced by close(), HelloWorld(), and subscribeToHelloWorld().
long cern::cmw::mom::test::HelloWorld::subscriptionToken = 0 [private] |
The subscription token.
Referenced by close(), and subscribeToHelloWorld().
final String cern::cmw::mom::test::HelloWorld::TEXT_MAP_FIELD = "TXT" [static, private] |
The MapMessage message fields.
Referenced by onMessage(), and publishToHelloWorld().
final String cern::cmw::mom::test::HelloWorld::TIMESTAMP_MAP_FIELD = "TS" [static, private] |
Referenced by onMessage(), and publishToHelloWorld().
1.6.2