Chapter 2. Application Assembly and Deployment


In any enterprise framework, it's important to understand not just the APIs and tools that are needed to develop application code but also the model that the framework uses for assembling and deploying the components of applications. Assembly of an application or component is the process of collecting all of the elements required (source code, datafiles, and configuration files) into a structured format that can be deployed to the server environment. Deploying a component or application is the process of actually installing the runnable code in the runtime environment, which involves making the code available to the server and resolving resource references in the assembly with the resources actually available on the server.

Assembly and deployment are usually considered separate activities for several reasons. Perhaps most importantly, assembly is focused on the nature of the application itself while deployment is focused on the integration of the application with a specific runtime environment. Assembly of code, therefore, is more easily standardized within a given enterprise framework. Archive structures and configuration file formats can be specified in a generic way, including references to external resources like databases and messaging services. Deployment, on the other hand, is more context-dependent. The type and configuration of the runtime environment are going to determine how each deployment will be carried out. The assembly itself will need to be installed in the runtime environment in different ways, depending on the architecture and configuration of the server. If an application requires a specific resource (as specified in its assembly), and a suitable resource is not available in the runtime environment, it will need to be provisioned before the application can be deployed. The physical steps needed to perform these deployment tasks vary for different runtime environments although the same application assembly is being deployed to each.

J2EE is no different in this regard. As we'll see in later chapters of this book, J2EE supports various types of application components (web-based components built using the Java Servlet, JavaServer Pages, and JavaServer Faces APIs; business components built using the Enterprise JavaBeans APIs; and so on). The J2EE specifications include standard archive formats and configuration file formats for application and component assemblies. These configuration files, called deployment descriptors , allow you to configure both the elements that make up the components and external resources required by the components at runtime. These resources are specified based on other standard Java APIs, such as JDBC (DataSources) and JMS (Destinations).

With a J2EE component or application archive in hand, deployment is carried out in a server-dependent fashion. The resource references in the assembly will need to be resolved, in some cases requiring new resources to be provisioned in the J2EE server. The assembly also needs to be physically delivered to the server somehow, in whatever scheme the server requires. Deploying the same J2EE assembly to multiple servers simply means performing these deployment operations for each environment. Ideally, the J2EE assembly itself (i.e., the physical packaging and description of the application and components) remains the same, and the variations in the server environments are handled in the deployment steps.

In this chapter, we present the general model that J2EE supports for assembling components and resources into full services or applications and how they are deployed to their runtime environments. As a complement to this tutorial material, Appendix A provides a reference for the key deployment descriptors defined in the J2EE family of specifications.



Java Enterprise in a Nutshell
Java Enterprise in a Nutshell (In a Nutshell (OReilly))
ISBN: 0596101422
EAN: 2147483647
Year: 2004
Pages: 269

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