Glossary:
Nirvana JavaScript : Finding a Channel
Once the session has been established with the Nirvana realm server, the session object can be used to locate an existing Nirvana Channel (nChannel) by specifying the channel's attributes (using a new nChannelAttributes object).
Note that you can use the Enterprise Manager GUI to create a Nirvana Channel.
This JavaScript code snippet demonstrates how to find a channel (for example /eur/rates):
var channelAttribs = new nChannelAttributes();
channelAttribs.setName("/eur/rates");
mySession.findChannel( channelAttribs, "postChannelFoundCallbackFunc" );
Note also that the findChannel call is asynchronous; it returns immediately, allowing single-threaded JavaScript clients to continue processing.
To enable the developer to know when a findChannel call has completed, the findChannel function takes two parameters: the first is the channel attributes object, and the second is the name of a developer-defined JavaScript function that will be called immediately after the findChannel actually completes.
A channel object (nChannel) will be passed as a parameter to this callback function if the channel was found. If the channel does not exist, the boolean value false will be passed to the callback function instead.
