Previous Contents Index DocHome Next |
iPlanet Application Server Programmer's Guide (Java) |
Chapter 10 Packaging for Deployment
This chapter describes the contents of iAS modules and how they are packaged to create an iAS application.ear file used for application deployment. The iAS modules include J2EE standard elements and iAS specific elements. Only iAS specific information is detailed in this chapter. Through out this chapter for J2EE specific information, you will find a reference to the appropriate J2EE specification.The following topics are presented in this chapter:
Overview of Packaging and Deployment
Overview of Packaging and Deployment
An iAS application is comprised of one or more iAS application modules, an iAS deployment descriptor (DD) and a J2EE application deployment descriptor (DD). All of these items are packaged, using the Java ARchive (JAR) file format, into one file with an extension of .ear (Enterprise ARchive). The deployment descriptors are used by the iAS Deployment Tool (iASDT) to deploy the application components and to register the resources with the iAS.Each of these application modules consist of either EJB, Web-application, Rich Client, or resource components, as well as an iAS deployment descriptor, and a J2EE deployment descriptor. For example, an EJB module would have one or more EJB components, an EJB deployment descriptor (DD) and an iAS EJB deployment descriptor (DD). There are two DDs for each module; one is a J2EE standard DD and the other is an iAS specific DD specified by this chapter.
Portions of the deployment descriptors for the application modules have been standardized by the J2EE specification, v1.1. For more information on these standards refer to the following specifications:
Java 2 Platform Enterprise Edition Specification, v1.2, Chapter 8 Application Assembly and Deployment - J2EE:application XML DTD
Java 2 Platform Enterprise Edition Specification, v1.2, Chapter 9 Application Clients - J2EE:application-client XML DTD
JavaServer Pages Specification, v1.1, Chapter 7 JSP Pages as XML Documents
JavaServer Pages Specification, v1.1, Chapter 5 Tag Extensions
Java Servlet Specification, v2.2 Chapter 13 Deployment Descriptor
Enterprise JavaBeans Specification, v1.1, Chapter 16 Deployment Descriptor
The diagram below illustrates how components are package into modules and then assembled into an iAS application .ear file ready for deployment.
Introducing XML DTDs
The Document Type Definition (DTD) defines the XML grammar for the deployment descriptors. There are two levels of deployment descriptors; there are application level descriptors, and component level descriptors. Applications are comprised of one or more components, one J2EE application deployment descriptor and one iAS application deployment descriptor.The J2EE platform provides packaging and deployment facilities. These facilities use Java ARchive (JAR) files as the standard package for components and applications, and XML-based deployment descriptors for customizing parameters. See chapter 7 "Packaging and Deployment" of the Developing Enterprise Applications with the Java 2 Platform, Enterprise Edition, v 1.0 for more information on the J2EE packaging and deployment process.
Application Deployment Descriptor
The deployment descriptor for an application, lists the application's components as modules. An iAS application will have two application deployment descriptors; one is a standard J2EE application DD and the other is an iAS application DD. The iAS application DD describes iAS specific deployment information for the iAS value-added features.
Component Deployment Descriptors
On the component level, each group of components packaged into a module will also have a J2EE component DD and an iAS component DD. An iAS application supports e web application, EJB, rich client and resource components. For each of these component types, there is a DTD to define the XML elements supported for that type of descriptor.
Creating Deployment Descriptors
All the deployment descriptors (DDs) needed for an iAS application are created using iPlanet Application Server Deployment Tool (iASDT). Refer to the iASDT documentation for further details on these procedures.
Deployment Descriptors
The application server uses deployment descriptors (DD) to properly deploy the application. The DDs are in the form of XML files that contain metadata describing deployment information about the J2EE modules (such as servlets, JSPs and EJBs) that make up your application. The information in each XML file is stored in a registry internal to the application server.Each application module must have an iAS XML DD file, and a J2EE XML DD file. Additionally, each application component must be associated with a globally unique identifier, or GUID.
The following is a list of all the types of deployment descriptors supported by iAS:
application DD and iAS application DD
web application DD and an iAS web application DD
Document Type Definition (DTD)
The Document Type Definition (DTD) describes the structure and properties of a class of XML DD files. Each DD will have exactly one element that completely contains all other elements (or sub elements).The descriptions of the elements found in the XML files are presented in a table format. These element tables have several fields that describe the purpose of the element and settings for the element's parameters. Some elements are hierarchical, that is they have parameters that are other elements (or sub elements). If a parameter contains an element, the description for that element can be found in another table describing that element.
The iAS Registry
The iAS registry is a collection of application metadata, organized in a tree, that is continually available in active memory or on a readily-accessible directory server. The process by which iAS gains access to servlets, EJBs, and other application resources is called registration, because it involves placing entries in the iAS registry for each item.You can change some of the information in the registry at run-time using the iAS Administrator Tool (iASAT). For more information about the registry, and the iASAT, see the Administration Guide.
GUIDs
A GUID is a 128-bit hexadecimal number that is assigned to an EJB and Servlet, and optionally to JSPs and is automatically generated by the iAS Deployment Tool. The GUID has the following format:{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
GUIDs are guaranteed to be globally unique, which makes them ideal for identifying components in a large-scale heterogeneous system such as an iAS application.
GUIDs are normally assigned automatically by the deployment tool, or by iPlanet Application Builder. You can generate a GUID manually by using a utility named kguidgen. kguidgen is installed by default into the directory BasePath/bin. That directory must be listed in your search path (your PATH environment variable in order to generate a GUID.
To generate a new GUID, simply run kguidgen from a command line or window.
Application XML DTD
The application Document Type Definition (DTD) describes the application Deployment Descriptor (DD). There is a J2EE application DD, defined by the J2EE specification, and an iAS application DD that is defined in this chapter.The iAS Deployment Tool (iASDT) is used to create the application DD, and also to deploy the application. Refer to the iASDT documentation for further details on these procedures.
J2EE Application DTD
See the Java Platform 2 Enterprise Edition, specification, v1.2 section 8.4 "J2EE:application XML DTD", for the application DTD description.
iAS Application DTD
This is the IAS 6.0 specific XML DTD for the Application ear file
The root element of the iAS application deployment descriptor.
This field create the mapping between the role name as it is known in the AppComponent, and then map them onto one or more LDAP defined user, group, etc. The deployment code simply treats each role-impl as an opaque string that's interpreted by the security infrastructure
ias-app ">
Table 10-2
ias-app
The name of the role as referred to in the <security-role> element
The string used to represent an LDAP group/user thing that makes up a particular role-name. A role imple could be any number of groups and/or users.
">
Table 10-3 role-mapping
The LDAP specific string that corresponds to a particular LDAP group
The LDAP specific string that corresponds to a particular LDAP user
">
Table 10-4 role-impl
The LDAP specific string that corresponds to a particular LDAP group
The LDAP specific string that corresponds to a particular LDAP user
Sample Application XML DD File
<?xml version="1.0"?><!DOCTYPE application PUBLIC '-//Sun Microsystems, Inc.//DTD J2EE Application 1.2//EN' 'http://java.sun.com/j2ee/dtds/application_1_2.dtd'>
<description>Application description</description>
<display-name>estore</display-name>
<context-root>estore</context-root>
<description>the customer role</description>
<role-name>customer</role-name>
Web Application XML DTD
This section provides an overview of web applications, the web application module and the web application deployment descriptor (DD). The DDs are created using iPlanet Application Server Deployment Tool (iASDT). Refer to the iASDT Administration and Deployment Guide for further details on these procedures.
Web Application Overview
Web applications run on web servers and may consist of servlets, JSPs, JSP Tag libraries, html pages, classes and other resources. The location of a web application is rooted at a specific path within the web server. An instance of a web application must only be run on one Virtual Machine (VM) at any one time, unless the application is marked as distributable by its deployment descriptor. When marked as distributable, the application may run on more than one VM at any one time and must follow a more restrictive set of rules outlined by the Java Servlet 2.2 specification.The web application is a composite of the following items:
Servlets
The web application is created by first assembling all the needed Web components into a Web application module along with module deployment descriptors (DD), and then packaging this web application module with all other modules that will be used by the J2EE application along with the application deployment descriptors (DD) into the final web application that is ready for deployment. A complete description of the J2EE assembly and deployment is available in the J2EE specification, chapter 8. See the URL:http://java.sun.com/j2ee.Static documents (html, images, sounds, etc.)
Client side applets, beans and classes
Descriptive meta information bundling all the above items together
Web Application XML DTD
This section provides the XML Document Type Definition (DTD) for the iAS specific Web application deployment descriptor (DD). Refer to section 8.4 of the J2EE specification for the standard J2EE application DD.The Web application DD supports the definition of elements that provide the following information:
Element for specifying an iAS Web Application
Elements for Specifying Servlet Information
The name of the servlet. This name must match the "servlet name" parameter in the J2EE web app XML exactly.
Each parameter group is represented by an event source name and the associated parameters.
Specifies whether or not the input parameters should be verified.
Examples for Setting Cache Criteria
The following examples provide some common usages and settings for the cache-criteria element.
Example 1
<cache-criteria>EmployeeCode</cache-criteria>This means caching is enabled if "EmployeeCode" is in the input parameter list.
Example 2
<cache-criteria>stock=NSCP</cache-criteria>This means caching is enabled is the value of the "stock" input parameter is "NSCP"
Example 3
<cache-criteria>*</cache-criteria>This means that caching is enabled whenever the value of the input parameters is the same as the value cached.
Example 4
<cache-criteria>dept=sales|marketing|support</cache-criteria>This means caching is enabled if the value of the "dept" parameter is either of sales or marketing or support.
Example 5
<cache-criteria>salary=40000-60000</cache-criteria>This means caching is enabled when the value of the input parameter "salary" is between 40000 and 60000.
Specifies each parameter by name and the rules that are applied to it for validation.
Each parameter is represented by a name and the rules that are applied to it for validation.
Description: Each parameter group is represented by an event source name and the associated parameters.
Name of the parameter input associated with the parameter group.
Elements for Specifying Session Information
Elements for Specifying EJB Reference Information
This is the storage place for the ABSOLUTE jndi name that the ejb-link in the corresponding J2EE XML file ejb-ref entry.
The ejb-link in the corresponding J2EE XML file ejb-ref entry.
Elements for Specifying Resource Reference Information
Elements for Specifying nls Settings
The nlsinfo element contains configuration information about application nls settings..
Elements for Specifying Role Mapping
LDAP specific string that corresponds to a particular LDAP group.
LDAP specific string that corresponds to a particular LDAP user.
EJB XML DTD
This section provides the EJB Document Type Definition (DTD) that is used by the EJB deployment descriptors. The DDs are created using iPlanet Application Server Deployment Tool (iASDT). Refer to the iASDT documentation for further details on how to create the DDs.
EJB Jar File Contents
The standard format used to package enterprise Beans is the ejb-jar file. This format is the contract between the Bean Provider and Application Assembler, and between the Application Assembler and the Deployer.The ejb-jar file must contain the deployment descriptor (DD) as well as all the class files for the following:
In addition, the ejb-jar file must contain the class files for all the classes and interfaces that the enterprise bean class, and the remote home interfaces depend on.
Specifying Parameter Passing Rules
When a servlet or EJB calls another bean that is co-located within the same process, iAS does not perform marshalling of all call parameters by default. This optimization allows the co-located case to execute far more efficiently than if strict "by-value" semantics were used. In certain cases, however, you may want to ensure that parameters passed to a bean are always passed by value. The iAS supports the ability to mark a bean or even a particular method within a bean as optionally requiring pass by value semantics. The parameter passing method used by the EJB is defined by the "pass-by-value" element. See the "pass-by-value" element description in the "session" or "entity" element table in this section. Because this option can decrease performance by greatly increasing call overhead, the default value is "false" if this entry is unspecified.
EJB iAS XML DTD
The following is the iAS specific XML DTD for EJB JAR files.
The root element of the iAS web application deployment descriptor.
The enterprise-beans element contains the declarations of one or more enterprise beans.
This is the storage place for the ABSOLUTE jndi name that the ejb-link in the corresponding J2EE XML file ejb-ref entry.
The ejb-link in the corresponding J2EE XML file ejb-ref entry.
LDAP specific string that corresponds to a particular LDAP group.
LDAP specific string that corresponds to a particular LDAP user.
Rich Client XML DTD
The Rich Client is an iAS specific type of J2EE client. A Rich Client supports the standard J2EE Application Client specifications and in addition supports direct access to iAS. For more information on Rich Client, refer to Chapter 10 Rich Client".A Rich Client jar file will contain two deployment descriptors (DDs) that are generated by the iASDT. One of these DDs is specified by the J2EE application-client XML Document Type Definition (DTD), that can be found in the J2EE Specification, v1.0 Chapter 9 Application Clients. The other DD contains iAS specific Rich Client elements; these elements are described in section <$paratext>" of this chapter.
For a sample Rich Client DD file, refer to section <$paratext>" in Appendix C, " Sample Deployment Files".
iAS Rich Client XML DTD
The ias-java-client-jar element is the root element of the Rich Client deployment descriptor.
Elements for Specifying EJB Reference Information
This is the storage place for the ABSOLUTE jndi name that the ejb-link in the corresponding J2EE XML file ejb-ref entry.
The ejb-link in the corresponding J2EE XML file ejb-ref entry.
Elements for Specifying Resource Reference Information
Resource XML DTD
Each iAS resource, such as a JDBC datasource, Java Mail and JMS, has a resource XML file. This XML file contains entries that are used to register the resource with iAS. These entries define the way iAS connects to that resource. These files are generated by the iAS Deployment Tool (iASDT). This section describes the resource XML file entries. For information on how to generate these files, refer to the iASDT documentation.
Datasource XML DTD
This section describes the XML DTD for the iAS datasource.
This is the root element of the resource deployment descriptor
The absolute jndi name of the resource factory (i.e. jdb/foo).
Rich Client Datasource XML DTD
Previous Contents Index DocHome Next
Copyright © 2000 Sun Microsystems, Inc. Some preexisting portions Copyright © 2000 Netscape Communications Corp. All rights reserved.
Last Updated June 25, 2000