JBoss.org Community Documentation

6.1. MainDeployerImpl

The org.jboss.deployers.plugins.deployment.MainDeployerImpl implementation of the org.jboss.deployers.spi.deployment.MainDeployer interfaces, includes the following standard method details:

  • DeploymentContext getDeploymentContext(String name) : obtain the DeploymentContext associated with the given name from all of the DeploymentContexts that have been added to the MainDeployer. This includes top level and all child contexts.

  • Collection <DeploymentContext> getTopLevel() : get a list of all of the top level DeploymentContexts added via the addDeploymentContext(DeploymentContext) method.

  • Collection <DeploymentContext> getAll() : get all of the DeploymentContexts, top-level and child associated with the MainDeployer.

  • Collection <DeploymentContext> getErrors() : get the DeploymentContexts that have failed to be structurally analyzed or deployed.

  • Collection <DeploymentContext> getMissingDeployer() : get the DeploymentContexts that are not deployed (isDeployed() == false) and are not root .jar files.

  • void addDeploymentContext(DeploymentContext context) throws DeploymentException : add a top-level deployment context. This runs a structural analysis of the DeploymentContext if its StructureDetermined state is not PREDETERMINED. If the structural analysis succeeds, the DeploymentContext is added for deployment during process.

  • boolean removeDeploymentContext(String name) throws DeploymentException : remove the top-level deployment associated with name.

  • void process() : runs through all DeploymentContexts that have been removed undeploys each top-level DeployemntContext. The undeployment involves invoking performUndeploy(DeploymentUnit) on each DeploymentContext.getDeploymentUnit(). Then for each component DeploymentContext, performUndeploy(DeploymentUnit) on the component DeploymentContext.getDeploymentUnit() is performed. Next, the top-level DeploymentContexts that have been added are deployed by invoking commitDeploy on each deployer. The details of the deployment process are that each deployer is run on top-level context DeploymentUnit by invoking Deployer.commitDeploy(DeploymentUnit), followed by the deployment of each context of the top-level DeploymentContext components (DeploymentContext.getComponents()).

  • void shutdown() : removes all top-level DeploymentContexts, and then invokes process to perform the undeployments.

In addition, the implementation adds the following methods.

  • public synchronized void addDeployer(Deployer deployer) : add a component deployer for non-structurual processing.

  • public synchronized void removeDeployer(Deployer deployer) : removes a component Deployer.

  • public synchronized Set <Deployer> getDeployers() : get the registered component deployers.

  • public synchronized void setDeployers(Set<Deployer> deployers) : set the component deployers.

  • public synchronized void addStructureDeployer(StructureDeployer deployer) : add a structural deployer.

  • public synchronized void removeStructureDeployer(StructureDeployer deployer) : remove a structural deployer.

  • public synchronized Set<StructureDeployer> getStructureDeployers() : obtain the registered structural deployers.

  • public synchronized void setStructureDeployers(Set<StructureDeployer> deployers) : set the structural deployers.