The Java JNDI
The Java Naming and Directory Interfaces (or JNDI) is an application programming interface
(API) built into Java that provides a standardised means for communicating and interacting with naming and directory
services. It is defined to be independent of any specific implementation of directory services.
The JNDI Architecture
The JNDI architecture consists of an API and a service provider interface (SPI). Java applications use the JNDI API to
access a variety of naming and directory services. This is illustrated in the following figure:
Note: This figure is the copyright of SUN Microsystems, and is reproduced with their
permission;
it is taken from their
JNDI Service Providers page.
The JNDI framework is used widely within the world of J2EE and EJB development, but is also available within the J2SE environment.
Most of the relevant components are to be found in the javax.naming and javax.naming.directory packages.
The JNDI structural model is analogous to that of a standard file/directory system; named bindings are stored within
contexts. In a hierarchical system, the bindings can themselves be either items of stored data or nested subcontexts.
The abstractions of the JNDI API mean that it can be used to access, and interact with, a wide range of different target
implementations, which include, for example, file systems, the windows registry and network-distributed services.
The JNDI framework is designed to facilitate standardised access across a wide range of naming and directory services,
and a variety of types of service provider. This means that the APIs often deal in abstractions and can appear to be quite
complex, and some parts of it might strike the unprepared as being unnecessarily so.
Fortunately, in the case of Stibium™, very little of this complexity is required, but must be accommodated to some extent
so that the implementation meets the specified requirements of the JNDI framework.
A service provider is expected to conform to the JNDI framework's requirements and specifications, some of which are nontrivial.
Once the service provider is registered with, and loaded by, the JNDI framework, its services become accessible to software
clients.
For More Information on JNDI See the Following: