The JNDI panel enables the creation of jms TopicConnectionFactory,
QueueConnectionFactory references as well as references
to Topics and Queues. If a realm is part of a cluster,
then the Nirvana JNDI context channel will be created
on all cluster realms. This ensures that any object
references bound into the context are available across
each realm.
Creating the context
When you select a realm node from the namespace tree,
one of the tabs on the right hand side of the Enterprise
Manager will be labelled 'JNDI'. Selecting this tab
will display the default JNDI panel for a realm. At
this point there will be nothing drawn within the JNDI
NameSpace tree. The image below shows the default JNDI
panel.

The JNDI panel at this point does not contain any JNDI
context information. By default, the 2 text fields labelled
'JNDI Context Factory' and 'JNDI Provider URL' will
already contain information. The JNDI context factory
specifies the class to use to the JNDI context, which
is set to 'com.pcbsys.nirvana.nSpace.NirvanaContextFactory',
being the name of the Nirvana JNDI context factory.
The JNDI provider URL is the RNAME
that each jndi connection reference will be created
using. For a realm that is part of a cluster,
the JNDI Provider URL will be a comma separated list
of the rname values for each realm that is a member
of the cluster. This ensures that not only will the
JNDI context be the same within all cluster realms,
but each jms client that uses the Nirvana Context Factory
will be able to use any of the realms specified in the
Provider URL.
Clicking on the 'Apply' button, will create the clustered
nirvana context channel used to store all JNDI references.
When this is created, each realm will then have a new
channel called /naming/defaultContext . Also, the JNDI
panel will also contain a new tree structure under the
panel labelled 'NameSpace', the root of which will be
the comma separated list of RNAME values. Double clicking
on the root node in the JNDI namespace will render 4
tree nodes labelled 'Topic Connection Factories', 'Queue
Connection Factories', 'Topics' and 'Queues'. The image
below shows this view after the 'Apply' button has been
clicked and the JNDI namespace tree has been double-clicked
to expand it.

In order to allow jms clients to use the Nirvana Context
Factory to reference objects via JNDI, we first of all
need to create Topic and Queue connection factories.
To do this, right click on the tree node labelled 'Topic
Connection Factories' and select the menu option 'New
Topic Connection Factory', which will display a dialog
box allowing you to enter the name for the connection
factory. Enter any name, in this example, we will use
the name 'TopicConnectionFactory'. Click on 'OK' when
you've entered the name, and you will see that a new
node will have been created under the 'Topic Connection
Factories' folder with the same name as you entered.
The image below shows the JNDI namespace with a newly
created topic connection factory.

As well as rendering the objects in the jndi namespace,
an event is also published onto the '/naming/defaultContext'
channel that corresponds to the newly entered connection
factory. This event is what will be referenced by JMS
clients when they attempt to find the details for the
connection factory.
When JMS clients use the Nirvana JNDI context, they
also reference the topics and queues from the same context.
In order for these clients to access these objects we
need to create references to each topic and queue. The
topics (nirvana channels) and queues may already exist
within the enterprise manager namespace, although they
may not have been created within the JNDI context. Either
way, by creating context references using the JNDI panel,
jms clients will be able to access those objects.
In this example, we will add a new topic into the JNDI
namespace that corresponds to a nirvana channel that
already exists as a cluster channel. To do this, first,
right-click on the folder called 'Topics' within the
jndi namespace, and select the menu option 'New Topic'.
If we enter the name /customer/sales, then a new object
will be created under the 'Topics' folder called '/customer/sales'.
This will also publish an event to the naming/defaultContext
channel so that jms clients can look up the reference
to this topic (channel) and begin using it within their
application. The following image shows the newly created
Topic within the JNDI namespace for the existing topic
/customer/sales.

Once we have created both the topic connection factory
and the topic, we can then see using the snoop
panel, those references as they correspond to events
on the naming/defaultContext channel. If you select
the naming/defaultContext channel from the enterprise
manager namespace and select the 'Snoop' panel. By selecting
the 'Start' button from the snoop panel, you will be
shown those JNDI entries that have been created. By
selecting on any of the events you will then see the
content of each event on the channel and the relevant
JNDI context information relevant to the jms applications
that will require it.
The image below shows and example of the Topic Connection
Factory created earlier as it was created using the
JNDI panel.

|