2.1.3. Deploying Applications
Deploying an application involves several steps, including resolving resource and
component references , managing the classloader used by the application server or servers,
and finally, physically deploying the application. We describe this process next.
18.104.22.168. Resolving resource and component references
Once we move our application assembly into an application server environment (i.e.,
deploy our application), we need to settle all of the resource and component references
contained in the various deployment descriptors. In the J2EE model, application servers
make resources available to applications through an internal directory, accessed at
runtime using the Java Naming and Directory Interface (JNDI). This internal directory
could be a full LDAP server, a CORBA Naming Service, or any other directory service
supported by JNDI.
Figure 2-3 shows the situation after a J2EE application assembly has been successfully
deployed to an application server environment. The resource and component references
in the module descriptors have been linked to deployed resources and components in the
application server. These references are linked through the application server's JNDI
service: components and resources have been deployed in the application server and
"published" in its JNDI service under specific names. These components and resources
are then linked to the references in the deployment descriptors in our deployed application,
and the application is fully deployed.
If a component reference in a deployment descriptor needs to be linked to a component
residing in the same application assembly, it's possible to make that link directly in the
module deployment descriptor, and not through the server's JNDI service. This is depicted
in Figure 2-3 by the "internal reference" link between the two modules in the application.
Otherwise, the resource and component references need to be resolved to real assets
through the application server's JNDI service.