The Java Tutorials have been written for JDK 8.Java教程是为JDK 8编写的。Examples and practices described in this page don't take advantage of improvements introduced in later releases and might use technology no longer available.本页中描述的示例和实践没有利用后续版本中引入的改进,并且可能使用不再可用的技术。See Java Language Changes for a summary of updated language features in Java SE 9 and subsequent releases.有关Java SE 9及其后续版本中更新的语言特性的摘要,请参阅Java语言更改。
See JDK Release Notes for information about new features, enhancements, and removed or deprecated options for all JDK releases.有关所有JDK版本的新功能、增强功能以及已删除或不推荐的选项的信息,请参阅JDK发行说明。
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.因此,可以用一种通用的方式访问各种目录——新的、新兴的和已经部署的目录。
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 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包进行了简要描述。