September 2002
Intermediate to advanced
608 pages
14h 20m
English
We skipped over some of the setup code in the previous example so that we could concentrate on the messaging functionality. Whenever clients and servers need to communicate, there must be a way for the side initiating the connection to locate the other side. With a typical sockets application, this is done via a well-known port number. For JMS, as well as several other J2EE APIs, the Java Naming and Directory Interface (JNDI) is used to facilitate this location. A service can register itself in a JNDI registry; clients can then look up the service by name. The process of using JNDI is straightforward:
The server obtains a connection to the JNDI registry via the call getInitialContext().
Using the initialContext ...
Read now
Unlock full access