|
Introducing JNDI |
|
| |
|
|
Introducing JNDIJNDI is a pure Java interface for general naming systems programming. JNDI provides a common layer of abstraction that insulates the application programmer from multiple interfaces for dealing with the naming aspects of an object system. These include listing, lookups, and managing naming attributes of an object. Although JNDI provides an interface to access named objects in naming systems, providers are required to implement certain JNDI methods for accessing a particular naming system. JNDI acts as a mediator between the application and one or more naming system providers. In addition to the JNDI methods for naming and accessing objects, the objects themselves may include additional, non-naming methods, such as printing or file read and write. Thus, JNDI provides the consistent access methods to get to objects but does not define the actual objects. JavaSoft owns, maintains, and documents the core specification and functionality defined in JNDI. You can read the official JNDI API specification. If you've written a program that works with NetWare and NDS, chances are you had to hard-code operations on names such as creation, deletion, renaming, among others-for each naming system you had to work with. JNDI levels the playing field, making all naming systems look alike. In JNDI, you access files, directories, NCP extensions, servers, and NDS objects through the Context interfaces. You can also access the attributes and schema of directory contexts through the DirContext interfaces. Because JNDI supports more than one Naming System, the functionality for a given context is dependent on the naming system it comes from. For example, contexts in the server naming system have different functionality than contexts in the file naming system. So, while you would use the exact same code to access the attributes of the context from the server naming system as the context from the file naming system, the attributes returned by the two contexts may be completely different. In JNDI, you can access all contexts and their functionality using only a few interfaces because JNDI abstracts the differences behind contexts. The architects of JNDI used this abstraction to free Java programmers from having to remember hundreds or even thousands of different contexts in multiple naming systems. In JNDI, you only need to use the core interfaces and their methods to work with all contexts. |
|
|
|
|||||||||