Chapter 9: Application Assembly and Deployment


Overview

The J2EE platform provides a high level of service standardization. As such, the application developer can focus on core business functions, and the container tools generate most of the services-specific code pertaining to transaction management, security, remote connectivity, object-relational mapping, and so on. The application behavior for these services is configured at deployment time using deployment descriptors. These deployment descriptors were discussed in Chapters 4 through 7 for configuring platform services for various components. Figure 9-1 shows how a J2EE application is composed, and the various elements that make up the web, EJB, and application client modules. J2EE modules either can be deployed as stand-alone units, or they can be combined to create a J2EE application, as shown in the figure.

click to expand
Figure 9-1: Elements of a J2EE application

Note

The sample application GreaterCause was developed and tested on the WebLogic Server 7.0 (SP1). As such, all discussion in this chapter refers to configuration actions that pertain to WebLogic Server 7.0. WebLogic 7.0 uses J2SE 1.3.1 SDK.

A J2EE module is a collection of one or more J2EE components of the same component type (web, EJB, or application client). It is the basic unit of composition of a J2EE application. A web application contains the application's resources, such as servlets, JSPs, JSP tag libraries, third-party libraries, and any other static resources such as HTML pages and image files. The web applications deployed in a J2EE server use a standard deployment descriptor (web.xml file) and a vendor-specific deployment descriptor (weblogic.xml) to define their resources and operating parameters. These web resources and the deployment descriptors are bundled together for deployment in a Java archive file called the web archive with the .war extension. The EJB components viz. session, entity, and message-driven beans are bundled for deployment in a Java archive file called the EJB archive with the .jar extension. The EJBs are configured and deployed using the standard deployment descriptor (ejb-jar.xml file) and a vendor-specific deployment descriptor (weblogic-ejb-jar.xml). The ejb-jar.xml deployment descriptor describes the enterprise beans packaged in the EJB archive file. It defines the beans’ type, names of their home and component interfaces, and implementation classes. It also defines the security roles and transactional behavior for the beans’ methods. For beans with container-managed persistence, there will be a vendor-specific deployment descriptor (weblogic-cmp-rdbms-jar.xml). It is used for specifying the mapping between the container-managed fields (and also the container-managed relationships) to the underlying RDBMS table schema.

The web archive (.war) and EJB archive (.jar) can be bundled into an enterprise archive with the .ear extension. Each enterprise archive file is packaged with an XML-based application.xml deployment descriptor that contains the application's name and description, and a list of the J2EE modules that comprise the application. The .ear file represents all the entities required to deploy the application on the server side. Each application component (web archive and EJB archive) is listed as a module in the application.xml deployment descriptor. Figure 9-2 depicts the steps involved in creating an application archive. We will apply these steps in the configuration and deployment of the sample GreaterCause application.

click to expand
Figure 9-2: Creating a J2EE application archive




Practical J2ee Application Architecture
Practical J2EE Application Architecture
ISBN: 0072227117
EAN: 2147483647
Year: 2003
Pages: 111
Authors: Nadir Gulzar

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net