J2EEOnline J2EEOnline


Distributed Objects   «Prev  Next»
Lesson 8Deployment descriptor and jar file
Objective Describe the Deployment Descriptor and the Jar File.

Describe the Deployment Descriptor and the Jar File

Beans and their deployment descriptors[1] can be packed in Java jar files[2] to make a uniform deployment unit.
Jar file

The jar file

The jar file is built with the Java jar program and contains the following:
  1. One or more beans
  2. A deployment descriptor for each bean
  3. Application assembly instructions
  4. Supporting classes and files

Deployment descriptor

The deployment descriptor (DD) describes everything that is needed to actually deploy a bean. In detail, the DD contains both structural and assembly information.

Structural information

The structural information describes the structure of a bean and declares the external dependencies.
It contains, at a minimum, the bean's
  1. name,
  2. class,
  3. home interface,
  4. remote interface,
  5. type,
  6. state,
  7. transaction settings, and
  8. security roles.
The home interface is used to find or create. The remote interface is used by the client and maps to the business methods of the bean.

The DD is written in XML

You may also wonder what format the DD takes. In version 1.1 of EJB the DD is described in terms of XML.
Question: Does this mean that you will have to learn XML to use EJBs?
Answer: Fortunately not.
Your EJB server or container vendor will provide an interactive tool that will make it easy for the bean developer and the deployer to edit values in the deployment descriptor and create and use the jar files.
In the next lesson, the different roles that developers play in developing EJBs will be discussed.

[1]Deployment descriptor: Information that describes both the structure of an Enterprise Java Bean, and the information required by it at runtime.
[2]Jar file: A file created with the Java jar program which is similar to tar on the Unix platform.