org.jboss.deployers.plugins.main
Class MainDeployerImpl

java.lang.Object
  extended by org.jboss.deployers.plugins.main.MainDeployerImpl
All Implemented Interfaces:
org.jboss.deployers.client.spi.DeployerClient, org.jboss.deployers.client.spi.main.MainDeployer, org.jboss.deployers.structure.spi.main.MainDeployerStructure

public class MainDeployerImpl
extends Object
implements org.jboss.deployers.client.spi.main.MainDeployer, org.jboss.deployers.structure.spi.main.MainDeployerStructure

MainDeployerImpl.

Version:
$Revision: 67379 $
Author:
Adrian Brock, Scott Stark, Ales Justin

Constructor Summary
MainDeployerImpl()
           
 
Method Summary
 void addDeployment(org.jboss.deployers.client.spi.Deployment deployment)
           
protected  void addDeployment(org.jboss.deployers.client.spi.Deployment deployment, boolean addToDeploy)
          Add a deployment
 void checkComplete()
           
 void checkComplete(org.jboss.deployers.client.spi.Deployment... deployments)
           
 void checkComplete(String... names)
           
 void checkStructureComplete(org.jboss.deployers.client.spi.Deployment... deployments)
           
 void checkStructureComplete(String... names)
           
 void deploy(org.jboss.deployers.client.spi.Deployment... deployments)
           
 Collection<org.jboss.deployers.structure.spi.DeploymentContext> getAll()
           
 org.jboss.util.graph.Graph<Map<String,org.jboss.managed.api.ManagedObject>> getDeepManagedObjects(String name)
           
 org.jboss.deployers.spi.deployer.Deployers getDeployers()
          Get the deployers
 org.jboss.deployers.client.spi.Deployment getDeployment(String name)
           
 org.jboss.deployers.structure.spi.DeploymentContext getDeploymentContext(String name)
           
 org.jboss.deployers.structure.spi.DeploymentContext getDeploymentContext(String name, boolean errorNotFound)
           
protected  org.jboss.deployers.structure.spi.DeploymentContext[] getDeploymentContexts(String... names)
          Get the deployment contexts.
protected static String[] getDeploymentNames(org.jboss.deployers.client.spi.Deployment... deployments)
          Get the names from deployments.
 org.jboss.deployers.spi.DeploymentState getDeploymentState(String name)
           
 org.jboss.deployers.structure.spi.DeploymentUnit getDeploymentUnit(String name)
           
 org.jboss.deployers.structure.spi.DeploymentUnit getDeploymentUnit(String name, boolean errorNotFound)
           
 Collection<org.jboss.deployers.structure.spi.DeploymentContext> getErrors()
           
 org.jboss.managed.api.ManagedDeployment getManagedDeployment(String name)
           
 Map<String,org.jboss.managed.api.ManagedObject> getManagedObjects(org.jboss.deployers.structure.spi.DeploymentContext context)
           
 Map<String,org.jboss.managed.api.ManagedObject> getManagedObjects(String name)
           
 org.jboss.deployers.spi.deployer.managed.ManagedDeploymentCreator getMgtDeploymentCreator()
           
 Collection<org.jboss.deployers.client.spi.Deployment> getMissingDeployer()
           
 org.jboss.deployers.structure.spi.StructuralDeployers getStructuralDeployers()
          Get the structural deployers
 Collection<org.jboss.deployers.client.spi.Deployment> getTopLevel()
           
 org.jboss.deployers.structure.spi.DeploymentContext getTopLevelDeploymentContext(String name)
          Get a top level deployment context by name
protected  void lockRead()
          Lock for read
protected  void lockWrite()
          Lock for write
 void process()
           
protected  void processManagedDeployment(org.jboss.deployers.structure.spi.DeploymentContext context, org.jboss.managed.api.ManagedDeployment parent)
          Recursively process the DeploymentContext into ManagedDeployments.
protected  void processManagedObjects(org.jboss.deployers.structure.spi.DeploymentContext context, org.jboss.util.graph.Graph<Map<String,org.jboss.managed.api.ManagedObject>> graph, org.jboss.util.graph.Vertex<Map<String,org.jboss.managed.api.ManagedObject>> parent)
          Get the managed objects for a context
 boolean removeDeployment(org.jboss.deployers.client.spi.Deployment deployment)
           
protected  boolean removeDeployment(org.jboss.deployers.client.spi.Deployment deployment, boolean addToUndeploy)
          Remove a deployment by name
 boolean removeDeployment(String name)
           
protected  boolean removeDeployment(String name, boolean addToUndeploy)
          Remove a deployment by name
 void setDeployers(org.jboss.deployers.spi.deployer.Deployers deployers)
          Set the deployers
 void setMgtDeploymentCreator(org.jboss.deployers.spi.deployer.managed.ManagedDeploymentCreator mgtDeploymentCreator)
           
 void setStructuralDeployers(org.jboss.deployers.structure.spi.StructuralDeployers deployers)
          Set the structural deployers
 void shutdown()
           
 void undeploy(org.jboss.deployers.client.spi.Deployment... deployments)
           
 void undeploy(String... names)
           
protected  void unlockRead()
          Unlock for read
protected  void unlockWrite()
          Unlock for write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MainDeployerImpl

public MainDeployerImpl()
Method Detail

getDeployers

public org.jboss.deployers.spi.deployer.Deployers getDeployers()
Get the deployers

Returns:
the deployers

setDeployers

public void setDeployers(org.jboss.deployers.spi.deployer.Deployers deployers)
Set the deployers

Parameters:
deployers - the deployers
Throws:
IllegalArgumentException - for null deployers

getStructuralDeployers

public org.jboss.deployers.structure.spi.StructuralDeployers getStructuralDeployers()
Get the structural deployers

Returns:
the structural deployers

setStructuralDeployers

public void setStructuralDeployers(org.jboss.deployers.structure.spi.StructuralDeployers deployers)
Set the structural deployers

Parameters:
deployers - the deployers
Throws:
IllegalArgumentException - for null deployers

getMgtDeploymentCreator

public org.jboss.deployers.spi.deployer.managed.ManagedDeploymentCreator getMgtDeploymentCreator()

setMgtDeploymentCreator

public void setMgtDeploymentCreator(org.jboss.deployers.spi.deployer.managed.ManagedDeploymentCreator mgtDeploymentCreator)

getDeployment

public org.jboss.deployers.client.spi.Deployment getDeployment(String name)
Specified by:
getDeployment in interface org.jboss.deployers.client.spi.DeployerClient

getDeploymentContext

public org.jboss.deployers.structure.spi.DeploymentContext getDeploymentContext(String name)
Specified by:
getDeploymentContext in interface org.jboss.deployers.structure.spi.main.MainDeployerStructure

getDeploymentContext

public org.jboss.deployers.structure.spi.DeploymentContext getDeploymentContext(String name,
                                                                                boolean errorNotFound)
                                                                         throws org.jboss.deployers.spi.DeploymentException
Specified by:
getDeploymentContext in interface org.jboss.deployers.structure.spi.main.MainDeployerStructure
Throws:
org.jboss.deployers.spi.DeploymentException

getDeploymentUnit

public org.jboss.deployers.structure.spi.DeploymentUnit getDeploymentUnit(String name)
Specified by:
getDeploymentUnit in interface org.jboss.deployers.structure.spi.main.MainDeployerStructure

getDeploymentUnit

public org.jboss.deployers.structure.spi.DeploymentUnit getDeploymentUnit(String name,
                                                                          boolean errorNotFound)
                                                                   throws org.jboss.deployers.spi.DeploymentException
Specified by:
getDeploymentUnit in interface org.jboss.deployers.structure.spi.main.MainDeployerStructure
Throws:
org.jboss.deployers.spi.DeploymentException

getTopLevelDeploymentContext

public org.jboss.deployers.structure.spi.DeploymentContext getTopLevelDeploymentContext(String name)
Get a top level deployment context by name

Parameters:
name - the name
Returns:
the context

getAll

public Collection<org.jboss.deployers.structure.spi.DeploymentContext> getAll()

getErrors

public Collection<org.jboss.deployers.structure.spi.DeploymentContext> getErrors()

getMissingDeployer

public Collection<org.jboss.deployers.client.spi.Deployment> getMissingDeployer()

getTopLevel

public Collection<org.jboss.deployers.client.spi.Deployment> getTopLevel()
Specified by:
getTopLevel in interface org.jboss.deployers.client.spi.DeployerClient

addDeployment

public void addDeployment(org.jboss.deployers.client.spi.Deployment deployment)
                   throws org.jboss.deployers.spi.DeploymentException
Specified by:
addDeployment in interface org.jboss.deployers.client.spi.DeployerClient
Throws:
org.jboss.deployers.spi.DeploymentException

addDeployment

protected void addDeployment(org.jboss.deployers.client.spi.Deployment deployment,
                             boolean addToDeploy)
                      throws org.jboss.deployers.spi.DeploymentException
Add a deployment

Parameters:
deployment - the deployment
addToDeploy - should we add this deployment to deploy collection
Throws:
org.jboss.deployers.spi.DeploymentException - for any error

removeDeployment

public boolean removeDeployment(org.jboss.deployers.client.spi.Deployment deployment)
                         throws org.jboss.deployers.spi.DeploymentException
Specified by:
removeDeployment in interface org.jboss.deployers.client.spi.DeployerClient
Throws:
org.jboss.deployers.spi.DeploymentException

removeDeployment

protected boolean removeDeployment(org.jboss.deployers.client.spi.Deployment deployment,
                                   boolean addToUndeploy)
                            throws org.jboss.deployers.spi.DeploymentException
Remove a deployment by name

Parameters:
deployment - thedeployment
addToUndeploy - should we add to undeploy collection
Returns:
false when the context was previously unknown
Throws:
org.jboss.deployers.spi.DeploymentException - for any error

removeDeployment

public boolean removeDeployment(String name)
                         throws org.jboss.deployers.spi.DeploymentException
Specified by:
removeDeployment in interface org.jboss.deployers.client.spi.DeployerClient
Throws:
org.jboss.deployers.spi.DeploymentException

removeDeployment

protected boolean removeDeployment(String name,
                                   boolean addToUndeploy)
                            throws org.jboss.deployers.spi.DeploymentException
Remove a deployment by name

Parameters:
name - the name of the deployment
addToUndeploy - should we add to undeploy collection
Returns:
false when the context was previously unknown
Throws:
org.jboss.deployers.spi.DeploymentException - for any error

deploy

public void deploy(org.jboss.deployers.client.spi.Deployment... deployments)
            throws org.jboss.deployers.spi.DeploymentException
Specified by:
deploy in interface org.jboss.deployers.client.spi.DeployerClient
Throws:
org.jboss.deployers.spi.DeploymentException

undeploy

public void undeploy(org.jboss.deployers.client.spi.Deployment... deployments)
              throws org.jboss.deployers.spi.DeploymentException
Specified by:
undeploy in interface org.jboss.deployers.client.spi.DeployerClient
Throws:
org.jboss.deployers.spi.DeploymentException

undeploy

public void undeploy(String... names)
              throws org.jboss.deployers.spi.DeploymentException
Specified by:
undeploy in interface org.jboss.deployers.client.spi.DeployerClient
Throws:
org.jboss.deployers.spi.DeploymentException

process

public void process()
Specified by:
process in interface org.jboss.deployers.client.spi.DeployerClient

shutdown

public void shutdown()
Specified by:
shutdown in interface org.jboss.deployers.client.spi.main.MainDeployer

checkComplete

public void checkComplete()
                   throws org.jboss.deployers.spi.DeploymentException
Specified by:
checkComplete in interface org.jboss.deployers.client.spi.DeployerClient
Throws:
org.jboss.deployers.spi.DeploymentException

getDeploymentNames

protected static String[] getDeploymentNames(org.jboss.deployers.client.spi.Deployment... deployments)
Get the names from deployments.

Parameters:
deployments - the deployments
Returns:
depolyment names

getDeploymentContexts

protected org.jboss.deployers.structure.spi.DeploymentContext[] getDeploymentContexts(String... names)
                                                                               throws org.jboss.deployers.spi.DeploymentException
Get the deployment contexts.

Parameters:
names - the deployment names
Returns:
depolyment contexts
Throws:
org.jboss.deployers.spi.DeploymentException - if context is not found

checkComplete

public void checkComplete(org.jboss.deployers.client.spi.Deployment... deployments)
                   throws org.jboss.deployers.spi.DeploymentException
Specified by:
checkComplete in interface org.jboss.deployers.client.spi.DeployerClient
Throws:
org.jboss.deployers.spi.DeploymentException

checkComplete

public void checkComplete(String... names)
                   throws org.jboss.deployers.spi.DeploymentException
Specified by:
checkComplete in interface org.jboss.deployers.client.spi.DeployerClient
Throws:
org.jboss.deployers.spi.DeploymentException

checkStructureComplete

public void checkStructureComplete(org.jboss.deployers.client.spi.Deployment... deployments)
                            throws org.jboss.deployers.spi.DeploymentException
Specified by:
checkStructureComplete in interface org.jboss.deployers.client.spi.DeployerClient
Throws:
org.jboss.deployers.spi.DeploymentException

checkStructureComplete

public void checkStructureComplete(String... names)
                            throws org.jboss.deployers.spi.DeploymentException
Specified by:
checkStructureComplete in interface org.jboss.deployers.client.spi.DeployerClient
Throws:
org.jboss.deployers.spi.DeploymentException

getDeploymentState

public org.jboss.deployers.spi.DeploymentState getDeploymentState(String name)
Specified by:
getDeploymentState in interface org.jboss.deployers.client.spi.DeployerClient

getManagedDeployment

public org.jboss.managed.api.ManagedDeployment getManagedDeployment(String name)
                                                             throws org.jboss.deployers.spi.DeploymentException
Specified by:
getManagedDeployment in interface org.jboss.deployers.client.spi.DeployerClient
Throws:
org.jboss.deployers.spi.DeploymentException

getManagedObjects

public Map<String,org.jboss.managed.api.ManagedObject> getManagedObjects(String name)
                                                                  throws org.jboss.deployers.spi.DeploymentException
Specified by:
getManagedObjects in interface org.jboss.deployers.client.spi.DeployerClient
Throws:
org.jboss.deployers.spi.DeploymentException

getManagedObjects

public Map<String,org.jboss.managed.api.ManagedObject> getManagedObjects(org.jboss.deployers.structure.spi.DeploymentContext context)
                                                                  throws org.jboss.deployers.spi.DeploymentException
Throws:
org.jboss.deployers.spi.DeploymentException

getDeepManagedObjects

public org.jboss.util.graph.Graph<Map<String,org.jboss.managed.api.ManagedObject>> getDeepManagedObjects(String name)
                                                                                                  throws org.jboss.deployers.spi.DeploymentException
Specified by:
getDeepManagedObjects in interface org.jboss.deployers.client.spi.DeployerClient
Throws:
org.jboss.deployers.spi.DeploymentException

processManagedObjects

protected void processManagedObjects(org.jboss.deployers.structure.spi.DeploymentContext context,
                                     org.jboss.util.graph.Graph<Map<String,org.jboss.managed.api.ManagedObject>> graph,
                                     org.jboss.util.graph.Vertex<Map<String,org.jboss.managed.api.ManagedObject>> parent)
                              throws org.jboss.deployers.spi.DeploymentException
Get the managed objects for a context

Parameters:
context - the context
graph - the graph
parent - the parent node
Throws:
org.jboss.deployers.spi.DeploymentException - for any problem

processManagedDeployment

protected void processManagedDeployment(org.jboss.deployers.structure.spi.DeploymentContext context,
                                        org.jboss.managed.api.ManagedDeployment parent)
                                 throws org.jboss.deployers.spi.DeploymentException
Recursively process the DeploymentContext into ManagedDeployments.

Parameters:
context - the context
parent - the parent
Throws:
org.jboss.deployers.spi.DeploymentException - for any error

lockRead

protected void lockRead()
Lock for read


unlockRead

protected void unlockRead()
Unlock for read


lockWrite

protected void lockWrite()
Lock for write


unlockWrite

protected void unlockWrite()
Unlock for write



Copyright ? 2007 JBoss Inc.. All Rights Reserved.