EE.2.5 Resource Adapters
第 EE.2.5 章 资源适配器
A resource adapter is a system-level software component that typically implements network connectivity to an external resource manager. A resource adapter can extend the functionality of the Java EE platform either by implementing one of the Java EE standard service APIs (such as a JDBC? driver), or by defining and implementing a resource adapter for a connector to an external application system. Resource adapters may also provide services that are entirely local, perhaps interacting with native resources. Resource adapters interface with the Java EE platform through the Java EE service provider interfaces (Java EE SPI). A resource adapter that uses the Java EE SPIs to attach to the Java EE platform will be able to work with all Java EE products.
资源适配器是一个系统级软件的组件。通常用于实现与外部资源管理器的网络连接。资源适配器可以通过实现Java EE标准服务API(比如JDBC驱动)或定义并实现一个连接外部应用程序系统的资源适配器的方式扩展Java EE平台的方法。资源适配器也可以提供完全本地的服务,如与原生资源交互。资源适配器通过Java EE 服供应商接口(Java EE SPI)与Java EE平台相连接。通过Java EE SPI附属在Java EE平台的资源适配器可以适配于所有的Java EE产品。
EE.2.6 Database
第 EE.2.6 章 数据库
The Java EE platform requires a database, accessible through the JDBC API, for the storage of business data. The database is accessible from web components, enterprise beans, and application client components. The database need not be accessible from applets.
Java EE平台需要一个可以通过JDBC API访问的数据库用以存放业务数据。数据库可以被Web组件、企业Bean和应用程序客户端访问。数据库不需要提供应用小程序的可访问性。
EE.2.7 Java EE Standard Services
第 EE.2.7 章 Java EE 标准服务
The Java EE standard services include the following (specified in more detail later in this document). Some of these standard services are actually provided by Java SE.
Java EE标准服务包含如下内容(详细信息将在本文档后面进行描述)。这些标准服务中的一些现在已经由Java SE支持。
EE.2.7.1 HTTP
第 EE.2.7.1 章 HTTP
The HTTP client-side API is defined by the java.net package. The HTTP serverside API is defined by the servlet, JSP, and JSF interfaces and by the web services support that is a part of the Java EE platform.
HTTP客户端API由java.net包定义。HTTP服务端的API由Servlet、JSP、JSF接口以及Web服务等Java EE平台的一部分进行定义。
EE.2.7.2 HTTPS
第 EE.2.7.2 章 HTTPS
Use of the HTTP protocol over the SSL protocol is supported by the same client and server APIs as HTTP.
使用基于SSL协议的HTTP协议也与HTTP使用相同的客户端和服务端API。
EE.2.7.3 Java? Transaction API (JTA)
第 EE.2.7.3 章 Java? 事务API(JTA)
The Java Transaction API consists of two parts:
Java事务API由两部分组成:
? An application-level demarcation interface that is used by the container and application components to demarcate transaction boundaries.
? 一个应用程序级的边界接口用于容器和应用程序组件划定事务的边界。
? An interface between the transaction manager and a resource manager used at the Java EE SPI level.
? 一个使用在Java EE SPI级别的、介于事务管理器和资源管理器之间的接口。
EE.2.7.4 RMI-IIOP
第 EE.2.7.4 章 RMI-IIOP
The RMI-IIOP subsystem is composed of APIs that allow for the use of RMI-style programming that is independent of the underlying protocol, as well as an implementation of those APIs that supports both the Java SE native RMI protocol (JRMP) and the CORBA IIOP protocol. Java EE applications can use RMI-IIOP, with IIOP protocol support, to access CORBA services that are compatible with the RMI programming restrictions (see the RMI-IIOP spec for details). Such CORBA services would typically be defined by components that live outside of a Java EE product, usually in a legacy system. Only Java EE application clients are required to be able to define their own CORBA services directly, using the RMI-IIOP APIs. Typically such CORBA objects would be used for callbacks when accessing other CORBA objects.
RMI-IIOP子系统是由独立于基础协议的,用于允许使用RMI形式的编程的API组成。同样,一个这些API的实现是同时基于Java SE原生RMI协议(JRMP)和CORBA IIOP协议。Java EE应用程序可以使用支持IIOP协议的RMI-IIOP来访问兼容RMI编程的CORBA服务(请参考RMI-IIOP规范中的详细信息)。这样的CORBA服务通常非Java EE产品的组件定义,通常是传统系统。只有Java EE应用程序客户端需要直接使用RMI-IIOP API来定义它们自己的CORBA服务。这样的CORBA的典型应用是用来作为访问其他CORBA对象的回调方法。
Java EE applications are required to use the RMI-IIOP APIs, specifically the narrow method of javax.rmi.PortableRemoteObject, when accessing Enterprise JavaBeans components, as described in the EJB specification. This allows enterprise beans to be protocol independent. Note that the most common use of the narrow method is not needed when using dependency injection instead of JNDI lookups; the container will perform the narrow for the application before injecting the object reference. Java EE products must be capable of exporting enterprise beans using the IIOP protocol, and accessing enterprise beans using the IIOP protocol, as specified in the EJB specification. The ability to use the IIOP protocol is required to enable interoperability between Java EE products, however a Java EE product may also use other protocols.
Java EE应用程序需要使用RMI-IIOP API(在javax.rmi.ProtableRemoteObject中明确定义的narrow方法)来访问EJB规范中描述的企业级JavaBean组件。这就允许了企业级Bean是独立于协议的。注意通常来说当使用依赖注入的方式替代JNDI查找的方式时,narrow方法并不需要。容器会在注入对象引用之前为应用程序调用narrow方法。如EJB规范所规定的那样,Java EE产品必须能够通过IIOP协议提供企业级Bean,并且同过IIOP协议访问企业级Bean。Java EE产品之间必须具备通过IIOP协议进行交互的能力,尽管Java EE产品中可能也使用了其他协议。
EE.2.7.5 Java IDL
第 EE.2.7.5 章 Java IDL
Java IDL allows Java EE application components to invoke external CORBA objects using the IIOP protocol. These CORBA objects may be written in any language and typically live outside a Java EE product. Java EE applications may use Java IDL to act as clients of CORBA services, but only Java EE application clients are required to be allowed to use Java IDL directly to present CORBA services themselves.
Java IDL 允许Java EE应用程序组件通过IIOP协议来调用外部的CORBA对象。这些CORBA对象通常存在于Java EE产品之外,并可以用任何语言来编写。Java EE应用程序可以使用Java IDL作为CORBA服务的客户端,但是只有Java EE应用程序客户端被要求允许使用Java IDL直接访问现有的CORBA服务本身。
EE.2.7.6 JDBC? API
第 EE.2.7.6 章 JDBC? API
The JDBC API is the API for connectivity with relational database systems. The JDBC API has two parts: an application-level interface used by the application components to access a database, and a service provider interface to attach a JDBC driver to the Java EE platform. Support for the service provider interface is not required in Java EE products. Instead, JDBC drivers should be packaged as resource adapters that use the facilities of the Connector API to interface with a Java EE product. The JDBC API is included in Java SE, but this specification includes additional requirements on JDBC device drivers.
JDBC API是与关系型数据库系统建立连接的API。JDBC API包含两个部分:一个应用程序级的接口用于应用程序组件访问数据库,和一个服务驱动接口用来连接Java EE平台的JDBC驱动。服务驱动接口不需要由Java EE产品提供。作为替代,JDBC驱动被打包为一个使用连接API连接Java EE产品的资源适配器。JDBC API被Java SE所包含,但是本规范包含了对JDBC设备驱动的额外要求。
EE.2.7.7 Java? Persistence API
第 EE.2.7.7 章 Java?持久化API
The Java Persistence API is the standard API for the management of persistence and object/relational mapping. This specification provides an object/relational mapping facility for application developers using a Java domain model to manage a relational database. The Java Persistence API is required to be supported in Java EE. It can also be used in Java SE environments.
Java持久化API是用于管理持久化和对象/关系映射的标准API。本规范为使用Java域模型管理关系型数据库的应用程序开发者提供了一个对象/关系映射工具。Java持久化API必须在Java EE中提供支持。它也可以用于Java SE环境。
EE.2.7.8 Java? Message Service (JMS)
第 EE.2.7.8 章 Java? 消息服务(JMS)
The Java Message Service is a standard API for messaging that supports reliable point-to-point messaging as well as the publish-subscribe model. This specification requires a JMS provider that implements both point-to-point messaging as well as publish-subscribe messaging.
Java消息服务是提供点对点消息模式和发布者-订阅者消息模式进行支持的标准API。本规范要求JMS供应商必须同时支持点对点消息模式和发布者-订阅者消息模式。
EE.2.7.9 Java Naming and Directory Interface? (JNDI)
第 EE.2.7.9 章 Java命名与目录接口(JNDI)
The JNDI API is the standard API for naming and directory access. The JNDI API has two parts: an application-level interface used by the application components to access naming and directory services and a service provider interface to attach a provider of a naming and directory service. The JNDI API is included in Java SE, but this specification defines additional requirements.
JNDI API是命名和目录访问的标准API。JNDI API包含两个部分:一个应用程序级的接口,用于应用程序组件访问命名和目录服务;以及一个服务供应商接口用于关联一个命名与目录服务的供应商。JNDI API包含在Java SE中,但是本规范定义了额外的要求。
EE.2.7.10 JavaMail?
第 EE.2.7.10 章 JavaMail?
Many Internet applications require the ability to send email notifications, so the Java EE platform includes the JavaMail API along with a JavaMail service provider that allows an application component to send Internet mail. The JavaMail API has two parts: an application-level interface used by the application components to send mail, and a service provider interface used at the Java EE SPI level.
许多互联网应用程序需要发送邮件通知的能力,因此Java EE平台包含一个JavaMail API和JavaMail服务供应商,用以应用程序组件发送互联网邮件。JavaMail API包含两部分:一个应用程序级的接口用于应用程序组件发送邮件,以及用于Java EE SPI级的服务供应商接口。
EE.2.7.11 JavaBeans? Activation Framework (JAF)
第 EE.2.7.11 JavaBeans?激活框架
The JAF API provides a framework for handling data in different MIME types, originating in different formats and locations. The JavaMail API makes use of the JAF API. The JAF API is included in Java SE and so is available to Java EE applications.
JAF API提供了一个处理不同MIME类型、不同格是和位置的数据的框架。JavaMail API利用了JAF API。JAF API包含在Java SE中,因此它在Java EE应用程序中是可用的。
EE.2.7.12 XML Processing
第 EE.2.7.12 章 XML处理
The Java? API for XML Processing (JAXP) provides support for the industry standard SAX and DOM APIs for parsing XML documents, as well as support for XSLT transform engines. The Streaming API for XML (StAX) provides a pullparsing API for XML. The JAXP and StAX APIs are included in Java SE and so are available to Java EE applications.
Java用于处理XML的API(JAXP)提供了行业标准的SAX和DOM API用来解析XML文档,同样也提供了XSLT转换引擎。XML流API(StAX)为XML提供了一个pull-parsing API。JAXP和StAX API包含在Java SE中,因此它们可以用于Java EE应用程序。
EE.2.7.13 Java EE? Connector Architecture
第 EE.2.7.13 章 Java EE? 连接器架构
The Connector architecture is a Java EE SPI that allows resource adapters that support access to Enterprise Information Systems to be plugged in to any Java EE product. The Connector architecture defines a standard set of system-level contracts between a Java EE server and a resource adapter. The standard contracts include:
连接器架构是允许资源适配器(提供对企业信息系统的访问)插入到任何Java EE产品的SPI。连接器架构定义了一组标准的在Java EE服务器和资源适配器之间的系统级的契约。这些标准契约包括:
? A connection management contract that lets a Java EE server pool connections to an underlying EIS, and lets application components connect to an EIS. This leads to a scalable application environment that can support a large number of clients requiring access to EIS systems.
? 一个连接管理契约,用于Java EE服务器池化基础EIS连接,以及使应用程序组件连接到EIS。这就提供了一个能够支持大量客户端访问请求的EIS系统的可扩展的应用程序环境。
? A transaction management contract between the transaction manager and an EIS that supports transactional access to EIS resource managers. This contract lets a Java EE server use a transaction manager to manage transactions across multiple resource managers. This contract also supports transactions that are managed internal to an EIS resource manager without the necessity of involving an external transaction manager.
? 一个在事务管理器和EIS之间的事务管理契约,提供对EIS资源管理器的事务级访问。这个契约使得Java EE服务器可以使用事务管理器来管理跨多个资源管理器的事务。契约也支持对一个EIS资源管理器内部的、不需要触发外部事务管理器的事务进行管理。
? A security contract that enables secure access to an EIS. This contract provides support for a secure application environment, which reduces security threats to the EIS and protects valuable information resources managed by the EIS.
? 一个安全契约,用于安全访问EIS。契约为应用程序提供了一个安全的环境,它减少了对EIS的安全威胁,保护了EIS管理的有价值的信息资源。
? A thread management contract that allows a resource adapter to delegate work to other threads and allows the application server to manage a pool of threads. The resource adapter can control the security context and transaction context used by the worker thread.
? 一个线程管理契约,以允许资源适配器可以委托工作给其他线程,或者允许应用程序服务器管理线程池。资源适配器可以通过辅助线程控制安全上下文和事务上下文。
? A contract that allows a resource adapter to deliver messages to message driven beans independent of the specific messaging style, messaging semantics, and messaging infrastructure used to deliver messages. This contract also serves as the standard message provider pluggability contract that allows a message provider to be plugged into any Java EE server via a resource adapter.
? 一个允许资源适配器发送不依赖于消息样式、消息语义、消息基础结构的消息到消息驱动Bean的契约。这个契约也座位标准消息供应商可插拔契约,以允许消息供应商可以通过资源适配器插拔于任何Java EE服务器。
? A contract that allows a resource adapter to propagate an imported transaction context to the Java EE server such that its interactions with the server and any application components are part of the imported transaction. This contract preserves the ACID (atomicity, consistency, isolation, durability) properties of the imported transaction.
? 一个允许资源适配器传播引入的事务上下文到Java EE服务器的契约,以实现与服务器和其他应用程序组件引入的事务的交互。契约保留了引入的事务的ACID(原子性、一致性、独立性、稳定性)特性。
? An optional contract providing a generic command interface between an application program and a resource adapter.
? 一个可选的契约,提供应用程序和资源适配器之间的一般的命令行接口。
EE.2.7.14 Security Services
第 EE.2.7.14 章 安全服务
The Java? Authentication and Authorization Service (JAAS) enables services to authenticate and enforce access controls upon users. It implements a Java technology version of the standard Plugable Authentication Module (PAM) framework and supports user-based authorization. The Java? Authorization Service Provider Contract for Containers (JACC) defines a contract between a Java EE application server and an authorization service provider, allowing custom authorization service providers to be plugged into any Java EE product.
Java认证与鉴权服务(JAAS)可以使服务可以认证并进行基于用户的强制访问控制。它实现了某个Java技术版本的标准可插拔认证模块(PAM)框架,并且支持基于用户的鉴权。用于容器的Java认证服务供应商契约(JACC)定义了Java EE应用程序服务器与鉴权服务供应商之间的契约,以允许自定义的鉴权服务供应商可以被用于任何Java EE产品。
EE.2.7.15 Web Services
第 EE.2.7.15 章 Web服务
Java EE provides full support for both clients of web services as well as web service endpoints. Several Java technologies work together to provide support for web services. The Java API for XML Web Services (JAX-WS) and the Java API for XML-based RPC (JAX-RPC) both provide support for web service calls using the SOAP/HTTP protocol. JAX-WS is the primary API for web services and is a follow-on to JAX-RPC. JAX-WS offers extensive web services functionality, with support for multiple bindings/protocols. JAX-WS and JAX-RPC are fully interoperable when using the SOAP 1.1 over HTTP protocol as constrained by the WS-I Basic Profile specification.
Java EE供应商完整的支持Web服务的客户端和Web服务的端点。一些Java技术协同工作来提供Web服务的支持。用于XML型Web服务的Java API(JAX-WS)和基于XML的RPC的Java API(JAX-RPC)都实现了通过SOAP/HTTP协议调用Web服务。JAX-WS是Web服务的主要API,它是JAX-RPC的后续技术。JAX-WS提供了广泛的Web服务的方式,并提供了多绑定/协议。JAX-WS和JAX-RPC可以在使用基于HTTP协议的SOAP 1.1版本(受WS-I基础配置规范约束)时,进行完全交互。
JAX-WS and the Java Architecture for XML Binding (JAXB) define the mapping between Java classes and XML as used in SOAP calls, and provides support for 100% of XML Schema. The SOAP with Attachments API for Java (SAAJ) provides support for manipulating low level SOAP messages. The Web Services for Java EE specification fully defines the deployment of web service clients and web service endpoints in Java EE, as well as the implementation of web service endpoints using enterprise beans. The Web Services Metadata specification defines Java language annotations that make it easier to develop web services. The Java API for XML Registries (JAXR) provides client access to XML registry servers.
JAX-WS和Java XML绑定架构(JAXB)定义了Java类和SOAP调用中使用的XML之间的映射关系,支持100%的XML模版。Java带有附件的SOAP API(SAAJ)被提供用于操作低等级的SOAP消息。用于Java EE的Web服务规范完整的定义了Web服务客户端的和Web服务端点的部署,以及如何使用企业级Bean实现Web服务端点。Web服务元数据规范定义了可以简化开发Web服务的注释(Annotation)。用于XML注册的Java API用于客户端访问XML注册服务器。
The Java API for RESTful Web Services (JAX-RS) provides support for web services using the REST style. RESTful web services better match the design style of the web and are often easier to access using a wide variety of programming languages. JAX-RS provides a simple high-level API for writing such web services as well as a low-level API that can be used to control all details of the web service interaction.
用于RESTful型Web服务的Java API(JAX-RS)提供了对REST形式的Web服务的支持。RESTful型的Web服务很好的匹配了Web的设计形式,并且通常更容易的被各种各样的编程语言访问。JAX-RS 提供了一个简单的高等级的API用于编写这样的Web服务,以及一个低等级的API用于控制Web服务相互作用的所有细节。
EE.2.7.16 Management
第 EE.2.7.16 章 管理
The Java 2 Platform, Enterprise Edition Management Specification defines APIs for managing Java EE servers using a special management enterprise bean. The Java? Management Extensions (JMX) API is also used to provide some management support.
Java 2 平台,企业版管理规范定义了使用特殊的管理企业级Bean管理Java EE服务器的API。Java管理扩展(JMX)API也用来提供一些管理的支持。
EE.2.7.17 Deployment
第 EE.2.7.17 章 部署
The Java 2 Platform, Enterprise Edition Deployment Specification defines a contract between deployment tools and Java EE products. The Java EE products provide plug-in components that run in the deployment tool and allow the deployment tool to deploy applications into the Java EE product. The deployment tool provides services used by these plug-in components.
Java 2 平台,企业版部署规范定义了部署工具和Java EE产品之间的契约。Java EE产品提供运行在部署工具中的插入式组件,并允许部署工具将应用程序部署到Java EE产品中。部署工具提供了这些插入式组件所使用的服务。
Figure EE.2-2 Java EE Interoperability 图 EE.2-2 Java EE 互操作性