| CONTENTS | PREV | NEXT | INDEX | J2EE BluePrints |
The J2EE packaging and deployment process involves three different development roles: Application Component Providers, Application Assemblers, and Deployers. The packaging and deployment tasks that each role performs are summarized in Figure 7.1.
Application Component Providers develop enterprise beans, HTML and JSP pages, and their associated helper classes. They supply the structural information of the deployment descriptor for each component. This information includes the home and remote interfaces and implementation classes of enterprise beans, the persistence mechanisms used, and the type of resources the components use, information typically hard coded in the application and not configurable at deployment time. Code Example 7.1 contains an excerpt from the sample application's enterprise bean deployment descriptor:
<entity> <display-name>TheAccount</display-name> <ejb-name>TheAccount</ejb-name> <home>com.sun.estore.account.ejb.AccountHome</home> <remote>com.sun.estore.account.ejb.Account</remote> <ejb-class> com.sun.estore.account.ejb.AccountEJB </ejb-class> <persistence-type>Bean</persistence-type> <prim-key-class>java.lang.String</prim-key-class> <reentrant>False</reentrant> <resource-ref> <description>description</description> <res-ref-name>jdbc/EstoreDataSource</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref> </entity>
| Code Example 7.1 Descriptor Elements for an Entity Bean |
Application Assemblers provide information related to the application as a
whole. In the sample application, the Application Assembler configures the file
Main.jsp to handle requests coming to the URL namespace, (/control/*),
the error pages the application uses, its security constraints and roles, and
so on. Code Example 7.2 contains excerpts
from the sample application's Web deployment descriptor:
<web-app> <display-name>JavaPetStoreDemoWebTier</display-name> <servlet> <servlet-name>webTierEntryPoint</servlet-name> <display-name>centralJsp</display-name> <description>central point of entry for the Web app </description> <jsp-file>Main.jsp</jsp-file> </servlet> <servlet-mapping> <servlet-name>webTierEntryPoint</servlet-name> <url-pattern>/control/*</url-pattern> </servlet-mapping> ... <error-page> <exception-type>java.lang.Exception</exception-type> <location>/errorpage.jsp</location> </error-page> ... </web-app>
| Code Example 7.2 Descriptor Elements for Web Application |
A Deployer is responsible for deploying J2EE components and applications into an operational environment. Deployment typically involves two tasks: