Documentation

The Java™ Tutorials
Hide TOC
Overview of JNDIJNDI概述
Trail: Java Naming and Directory Interface

Lesson: Overview of JNDI

The Java Naming and Directory Interface™ (JNDI) is an application programming interface (API) that provides naming and directory functionality to applications written using the Java™ programming language. Java命名目录接口™(JNDI)是一个应用程序编程接口(API),它为使用Java™编程语言。It is defined to be independent of any specific directory service implementation. 它被定义为独立于任何特定的目录服务实现。Thus a variety of directories -new, emerging, and already deployed can be accessed in a common way.因此,可以用一种通用的方式访问各种目录——新的、新兴的和已经部署的目录。

Architecture体系结构

The JNDI architecture consists of an API and a service provider interface (SPI). JNDI体系结构由一个API和一个服务提供者接口(SPI)组成。Java applications use the JNDI API to access a variety of naming and directory services. Java应用程序使用JNDI API来访问各种命名和目录服务。The SPI enables a variety of naming and directory services to be plugged in transparently, thereby allowing the Java application using the JNDI API to access their services. SPI允许透明地插入各种命名和目录服务,从而允许Java应用程序使用JNDI API访问它们的服务。See the following figure:如下图所示:

JNDI Architecture

Packaging

JNDI is included in the Java SE Platform. To use the JNDI, you must have the JNDI classes and one or more service providers. JNDI包含在Java SE平台中。要使用JNDI,必须具有JNDI类和一个或多个服务提供程序。The JDK includes service providers for the following naming/directory services:JDK包括以下命名/目录服务的服务提供商:

Other service providers can be downloaded from the JNDI page or obtained from other vendors.其他服务提供商可以从JNDI页面下载,也可以从其他供应商处获得。

The JNDI is divided into five packages:JNDI分为五个包:

The next part of the lesson has a brief description of the JNDI packages.本课程的下一部分对JNDI包进行了简要描述。


Previous page: Previous Lesson
Next page: Naming Package