What Is JNDI?

JNDI is a unified Java API designed to standardized access to a variety of naming and directory services. This abstract mechanism is what makes J2EE an attractive enterprise architecture for Internet and intranet applications. Applications are written in a standard way to use the JNDI API, which transparently calls the underlying naming or directory service. A JNDI-compliant service must implement part of the JNDI API. Here is a brief description of the two parts that make up the JNDI architecture:

  • An application-level programming interface (API). APIs are used by the application components to access naming and directory services.

  • A service provider interface (SPI). This part of the API is used to plug in a provider of a naming and directory service to the J2EE platform.

Figure 4.2 illustrates these APIs.

Figure 4.2. JNDI architecture.


The JNDI model defines a hierarchical namespace in which you name objects. Each object in the namespace may have attributes that can be used to search for the object.

Note

It's important to remember that JNDI is an interface or an API, and not an implementation, to abstract the access layer to naming and directory service providers.


Naming and directory services are intimate partners. In fact, most existing products provide both sets of functionality. Naming services provide name-to-object mapping, and directory services provide information about the objects and tools for searching for them.

As part of the common J2EE services, JNDI enables seamless connectivity to heterogeneous enterprise naming and directory services. Developers can build powerful and portable directory-enabled applications using the JNDI standard.

Note

JNDI naming and directory services are best used in maintaining small amounts of stable data that is accessible to all servers.


..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.223.206.69