220.127.116.11. Java Naming and Directory Interface (JNDI)
Working with directory services JNDI is the Java Enterprise API for working with networked naming and directory services. It allows Java programs to use name servers and directory servers to look up objects or data by name and search for objects or data according to a set of specified attribute values.
JNDI is implemented in the javax.naming package and its subpackages as a core API in the Java platform.
The JNDI API is not specific to any particular name or directory server protocol. Instead,
it is a generic API that is general enough to work with any name or directory server. To
support a particular protocol, plug a service provider for that protocol into a JNDI
installation. Service providers have been implemented for the most common protocols,
such as LDAP, Active Directory, and Novell's NDS. Service providers have also been written
to interact with the RMI and CORBA object registries.
JNDI also plays a key role in the J2EE framework since it is the API used to access runtime
configuration information and resources by J2EE applications. Information specified in
component deployment descriptors is made available to components by the application
server through an internal name server, and the application components access this name
server through JNDI.
JNDI is covered in detail in Chapter 9.