JBoss.org Community Documentation

22.1. Introduction

Once the structure of a deployment has been determined then the next step is to create a number of DeploymentContext objects. A DeploymentContext is required for each deployment, whether top-level or nested, in order to store information such as:

  • the location of any deployment descriptors - the metadata path

  • the location of any classes - the classpath

  • the relative path to the top-level deployment - the relative path

  • the deployment name

  • the order it should be deployed in relative to other deployments - the relative order

  • a list of deployment types that it represents (including nested deployments) - the types

  • the state of the deployment - whether it is deployed or not

  • the deployment class loader

  • the deployment resource loader

  • dependencies on other deployments or runtime components

  • references to any components that it deploys - POJOs, MBeans etc...

  • references to any nested (child) deployments or the parent deployment

Since the StructureMetaData object created using the StructureDeployer implementations already contains some of this information we subsequently pass it to a StructureBuilder together with a reference to the original Deployment to populate the deployment with a tree of DeploymentContexts:

public interface StructureBuilder
   DeploymentContext populateContext(Deployment deployment, StructureMetaData metaData) throws DeploymentException;

During this method call the information contained within the ContextInfo objects, found inside the StructureMetaData , is transferred to new instances of DeploymentContext that are assembled into a hierarchy. A reference to the top-level DeploymentContext is then returned.