Oracle GlassFish Server 3.0.1 Application Deployment Guide

Modules and Applications

A module is a collection of one or more Java EE components that run in the same container type, such as a web container or EJB container. The module uses annotations or deployment descriptors of that container type. You can deploy a module alone or as part of an application.

The following topics are addressed here:

Types of Modules

GlassFish Server supports the following types of modules:

Module–Based Deployment

You can deploy web, EJB, and application client modules separately, outside of any application. Module–based deployment is appropriate when components need to be accessed by other modules, applications, or application clients. Module-based deployment allows shared access to a bean from a web, EJB, or application client component. By using package definitions in the source code of all modules, you eanble the class loader to properly locate the classes after the modules have been deployed.

The following figure shows separately-deployed EJB, web, and application client modules.

Figure 1–1 Module–Based Assembly and Deployment

Figure shows EJB, web, and `application client
module assembly and deployment.

Application-Based Deployment

An application is a logical collection of one or more modules joined by application annotations or deployment descriptors. You assemble components into JAR, WAR, or RAR files, then combine these files into an Enterprise archive (EAR) file which is deployed.

The following figure shows EJB, web, application client, and connector modules assembled into a Java EE application.

Figure 1–2 Application–Based Assembly and Deployment

Figure shows Java EE application assembly and