Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Enterprise JavaBeans™ Specification, Version 2.0 - Sun Microsystems.pdf
Скачиваний:
14
Добавлен:
24.05.2014
Размер:
2.71 Mб
Скачать

Sun Microsystems Inc

Overview

Enterprise JavaBeans 2.0, Public Draft

Ejb-jar file

Chapter 22 Ejb-jar file

The ejb-jar file is the standard format for packaging of enterprise Beans. The ejb-jar file format is used to package un-assembled enterprise beans (the Bean Provider’s output), and to package assembled applications (the Application Assembler’s output).

22.1 Overview

The ejb-jar file format is the contract between the Bean Provider and Application Assembler, and between the Application Assembler and the Deployer.

An ejb-jar file produced by the Bean Provider contains one or more enterprise beans that typically do not contain application assembly instructions. An ejb-jar file produced by an Application Assembler (which can be the same person or organization as the Bean Provider) contains one or more enterprise beans, plus application assembly information describing how the enterprise beans are combined into a single application deployment unit.

457

5/31/00

Sun Microsystems Inc.

Ejb-jar file

Enterprise JavaBeans 2.0, Public Draft

Deployment descriptor

22.2 Deployment descriptor

The ejb-jar file must contain the deployment descriptor in the format defined in Chapter 21. The deployment descriptor must be stored with the name META-INF/ejb-jar.xml in the ejb-jar file.

22.3 Class files

For each enterprise bean, the ejb-jar file must include the class files of the following:

The enterprise bean class.

The enterprise bean home and remote interface, unless the bean is a message-driven bean.

The primary key class if the bean is an entity bean.

The ejb-jar file must also contain the class files for all the classes and interfaces that the enterprise bean class, and the remote and home interfaces depend on. This includes their superclasses and superinterfaces, dependent classes, and the classes and interfaces used as method parameters, results, and exceptions.

An ejb-jar file does not have to include the class files of the home and remote interfaces of an enterprise bean that is referenced by an enterprise bean in the ejb-jar, or other classes needed by the referenced enterprise bean, if the referenced enterprise bean or needed classes are defined in another jar file that is named in the Class-Path attribute in the Manifest file of the referencing ejb-jar file, or the transitive closure of such Class-Path references. Note that this Class-Path mechanism only works with JDK 1.2 and later.

22.4 ejb-client JAR file

The ejb-jar file producer can create an ejb-client JAR file for the ejb-jar file. The client-ejb JAR file contains all the class files that a client program needs to use the client view of the enterprise beans that are contained in the ejb-jar file.

The ejb-client JAR file is specified in the deployment descriptor of the ejb-jar file using the optional ejb-client-jar element. The value of the ejb-client-jar element is the path name specifying the location of the ejb-client JAR file in the containing J2EE Enterprise Application Archive (.ear) file. The path name is relative to the location of the referencing ejb-jar file. The Deployer should ensure that the specified ejb-client JAR file is accessible to the client program’s class-loader. If no ejb-cli- ent-jar element is specified, the Deployer should make the entire ejb-jar file accessible to the client’s class-loader.

5/31/00

458