An Introduction to the Java Naming and Directory Interface


The Java Naming and Directory Interface ( JNDI ) provides the interface to a naming and directory service for Java applications including J2EE technology. It is extremely important to understand that JNDI does not provide the specification for the actual naming service; rather, it provides an independent, neutral and unified interface to the provider of the actual naming service. Its purpose, as used by J2EE, is to enable Java applications to locate remote objects on the network. The semantics of a naming service are very much like those of a hash table, where a unique name is paired with an object. The binding between the name and object is stored persistently by the service provider being accessed through JNDI. Examples of JNDI service providers include the Lightweight Directory Access Protocol (LDAP) server, Domain Naming Service (DNS), Network Information Service (NIS) and the RMI Registry.

The naming service provider allows the object to be retrieved by simply looking up its JNDI name, which is set by the object's deployer in the deployment descriptor. The naming service is an integral part of all distributed processing middleware implementing RMI, CORBA or J2EE technologies. With any of these technologies, the typical scenario for a client to use a remote object is as follows :

  1. The remote interface must be registered with the naming service.

  2. The client uses JNDI to look up the registered name in the naming service and retrieve the remote object that is bound to that name.

  3. The return value is an object that implements the remote interface.

  4. The client uses the remote interface to communicate with the remote object.



BEA WebLogic Platform 7
BEA WebLogic Platform 7
ISBN: 0789727129
EAN: 2147483647
Year: 2003
Pages: 360

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net