org.jboss.deployers.structure.spi.helpers
Class ComponentDeploymentContext

java.lang.Object
  extended by org.jboss.deployers.structure.spi.helpers.ComponentDeploymentContext
All Implemented Interfaces:
Serializable, org.jboss.deployers.spi.attachments.ManagedObjectAttachments, org.jboss.deployers.spi.attachments.ManagedObjectsWithTransientAttachments, org.jboss.deployers.spi.attachments.PredeterminedManagedObjectAttachments, DeploymentContext

public class ComponentDeploymentContext
extends Object
implements DeploymentContext

AbstractDeploymentContext.

Version:
$Revision: 59630 $
Author:
Adrian Brock, Scott.Stark@jboss.org
See Also:
Serialized Form

Field Summary
protected  org.jboss.logging.Logger log
          The log
 
Constructor Summary
ComponentDeploymentContext()
          For serialization
ComponentDeploymentContext(String name, DeploymentContext parent)
          Create a new ComponentDeploymentContext.
 
Method Summary
 void addChild(DeploymentContext child)
          Add a child
 void addComponent(DeploymentContext component)
          Add a component
 void addControllerContextName(Object name)
          Add controller context name.
 void cleanup()
          Cleanup the deployment context
 boolean createClassLoader(ClassLoaderFactory factory)
          Create a classloader
 void deployed()
          Touch the context to say it is deployed
 List<DeploymentContext> getChildren()
          The children
 ClassLoader getClassLoader()
          Gets the classloader for this deployment unit
 Comparator<DeploymentContext> getComparator()
          Get the comparator.
 List<DeploymentContext> getComponents()
          The components
 Set<Object> getControllerContextNames()
          Get the controller context names.
 org.jboss.dependency.spi.DependencyInfo getDependencyInfo()
          Get the dependency info
 org.jboss.deployers.client.spi.Deployment getDeployment()
          Get the deployment (if this is a top level context)
 DeploymentUnit getDeploymentUnit()
          Get the deployment unit
 org.jboss.metadata.spi.MetaData getMetaData()
          Get the metadata for this deployment context
 org.jboss.metadata.spi.MutableMetaData getMutableMetaData()
          Get the mutable metadata for this deployment context
 org.jboss.metadata.spi.scope.ScopeKey getMutableScope()
          Get the mutable scope
 String getName()
          Get the deployment name
 DeploymentContext getParent()
          The parent
 org.jboss.deployers.spi.attachments.Attachments getPredeterminedManagedObjects()
           
 Throwable getProblem()
          Get the problem for this context
 int getRelativeOrder()
          Get the relative order
 String getRelativePath()
          Get the path of this deployment relative to the top of the deployment vfs path ------------------- relative path deploy/some.ear "" deploy/some.ear/x.ejb "/x.ejb" deploy/some.ear/y.sar "/y.sar" deploy/some.ear/y.sar/z.rar "/y.sar/z.rar"
 ClassLoader getResourceClassLoader()
          Get a resource classloader
 DeploymentResourceLoader getResourceLoader()
          Get a resource loader
 org.jboss.metadata.spi.scope.ScopeKey getScope()
          Get the scope
 String getSimpleName()
          Get the simple vfs name of the deployment unit.
 org.jboss.deployers.spi.DeploymentState getState()
          Get the deployment state
 DeploymentContext getTopLevel()
          Get the top level deployment
 org.jboss.deployers.spi.attachments.MutableAttachments getTransientAttachments()
           
 org.jboss.deployers.spi.attachments.MutableAttachments getTransientManagedObjects()
           
 Set<String> getTypes()
          Get the deployment types associated with this deployment.
 boolean isComponent()
          Whether this is a component
 boolean isDeployed()
          Whether the deployment was processed
 boolean isTopLevel()
          Whether this is a top level deployment
 boolean removeChild(DeploymentContext child)
          Remove a child
 void removeClassLoader()
          Remove the classloader created by the factory
 void removeClassLoader(ClassLoaderFactory factory)
          Remove the classloader
 boolean removeComponent(DeploymentContext component)
          Remove a component
 void removeControllerContextName(Object name)
          Remove controller context name.
 void setClassLoader(ClassLoader classLoader)
          Set the class loader
 void setComparator(Comparator<DeploymentContext> comparator)
          Set the comparator.
 void setDeployment(org.jboss.deployers.client.spi.Deployment deployment)
          Set the deployment
 void setDeploymentUnit(DeploymentUnit unit)
          Set the deployment unit
 void setMetaDataPath(String path)
           
 void setMutableScope(org.jboss.metadata.spi.scope.ScopeKey mutableScope)
          Set the mutable scope
 void setParent(DeploymentContext parent)
          Set the parent
 void setPredeterminedManagedObjects(org.jboss.deployers.spi.attachments.Attachments objects)
           
 void setProblem(Throwable problem)
          Set the problem for this context
 void setRelativeOrder(int relativeOrder)
          Set the relative order
 void setScope(org.jboss.metadata.spi.scope.ScopeKey scope)
          Set the scope
 void setState(org.jboss.deployers.spi.DeploymentState state)
          Set the deployment state
 String toString()
           
 void visit(DeploymentContextVisitor visitor)
          Visit the context and the children
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

protected org.jboss.logging.Logger log
The log

Constructor Detail

ComponentDeploymentContext

public ComponentDeploymentContext()
For serialization


ComponentDeploymentContext

public ComponentDeploymentContext(String name,
                                  DeploymentContext parent)
Create a new ComponentDeploymentContext.

Parameters:
name - the name
parent - the parent
Throws:
IllegalArgumentException - if the name or parent is null
Method Detail

getName

public String getName()
Description copied from interface: DeploymentContext
Get the deployment name

Specified by:
getName in interface DeploymentContext
Returns:
the name

getControllerContextNames

public Set<Object> getControllerContextNames()
Description copied from interface: DeploymentContext
Get the controller context names.

Specified by:
getControllerContextNames in interface DeploymentContext
Returns:
the names

addControllerContextName

public void addControllerContextName(Object name)
Description copied from interface: DeploymentContext
Add controller context name.

Specified by:
addControllerContextName in interface DeploymentContext
Parameters:
name - the controller context name

removeControllerContextName

public void removeControllerContextName(Object name)
Description copied from interface: DeploymentContext
Remove controller context name.

Specified by:
removeControllerContextName in interface DeploymentContext
Parameters:
name - the controller context name

getSimpleName

public String getSimpleName()
Description copied from interface: DeploymentContext
Get the simple vfs name of the deployment unit. This is the simple name of the virtual file . vfs path ------------------- relative path deploy/some.ear "some.ear" deploy/some.ear/x.ejb "x.ejb" deploy/some.ear/y.sar "y.sar" deploy/some.ear/y.sar/z.rar "z.rar"

Specified by:
getSimpleName in interface DeploymentContext
Returns:
the deployment unit simple path

getRelativePath

public String getRelativePath()
Description copied from interface: DeploymentContext
Get the path of this deployment relative to the top of the deployment vfs path ------------------- relative path deploy/some.ear "" deploy/some.ear/x.ejb "/x.ejb" deploy/some.ear/y.sar "/y.sar" deploy/some.ear/y.sar/z.rar "/y.sar/z.rar"

Specified by:
getRelativePath in interface DeploymentContext
Returns:
the top-level deployment relative path

getRelativeOrder

public int getRelativeOrder()
Description copied from interface: DeploymentContext
Get the relative order

Specified by:
getRelativeOrder in interface DeploymentContext
Returns:
the relative order

setRelativeOrder

public void setRelativeOrder(int relativeOrder)
Description copied from interface: DeploymentContext
Set the relative order

Specified by:
setRelativeOrder in interface DeploymentContext
Parameters:
relativeOrder - the relativeOrder

getComparator

public Comparator<DeploymentContext> getComparator()
Description copied from interface: DeploymentContext
Get the comparator.

Specified by:
getComparator in interface DeploymentContext
Returns:
the comparator.

setComparator

public void setComparator(Comparator<DeploymentContext> comparator)
Description copied from interface: DeploymentContext
Set the comparator.

Specified by:
setComparator in interface DeploymentContext
Parameters:
comparator - the comparator.

getTypes

public Set<String> getTypes()
Description copied from interface: DeploymentContext
Get the deployment types associated with this deployment.

Specified by:
getTypes in interface DeploymentContext
Returns:
set of deployment type names deployers have identified in this deployment.

getScope

public org.jboss.metadata.spi.scope.ScopeKey getScope()
Description copied from interface: DeploymentContext
Get the scope

Specified by:
getScope in interface DeploymentContext
Returns:
the scope

setScope

public void setScope(org.jboss.metadata.spi.scope.ScopeKey scope)
Description copied from interface: DeploymentContext
Set the scope

Specified by:
setScope in interface DeploymentContext
Parameters:
scope - the scope key

getMutableScope

public org.jboss.metadata.spi.scope.ScopeKey getMutableScope()
Description copied from interface: DeploymentContext
Get the mutable scope

Specified by:
getMutableScope in interface DeploymentContext
Returns:
the mutable scope

setMutableScope

public void setMutableScope(org.jboss.metadata.spi.scope.ScopeKey mutableScope)
Description copied from interface: DeploymentContext
Set the mutable scope

Specified by:
setMutableScope in interface DeploymentContext
Parameters:
mutableScope - the mutable scope key

getMetaData

public org.jboss.metadata.spi.MetaData getMetaData()
Description copied from interface: DeploymentContext
Get the metadata for this deployment context

Specified by:
getMetaData in interface DeploymentContext
Returns:
the metadata

getMutableMetaData

public org.jboss.metadata.spi.MutableMetaData getMutableMetaData()
Description copied from interface: DeploymentContext
Get the mutable metadata for this deployment context

Specified by:
getMutableMetaData in interface DeploymentContext
Returns:
the metadata

getState

public org.jboss.deployers.spi.DeploymentState getState()
Description copied from interface: DeploymentContext
Get the deployment state

Specified by:
getState in interface DeploymentContext
Returns:
the state

setState

public void setState(org.jboss.deployers.spi.DeploymentState state)
Description copied from interface: DeploymentContext
Set the deployment state

Specified by:
setState in interface DeploymentContext
Parameters:
state - the state

getDeploymentUnit

public DeploymentUnit getDeploymentUnit()
Description copied from interface: DeploymentContext
Get the deployment unit

Specified by:
getDeploymentUnit in interface DeploymentContext
Returns:
the deployment

setDeploymentUnit

public void setDeploymentUnit(DeploymentUnit unit)
Description copied from interface: DeploymentContext
Set the deployment unit

Specified by:
setDeploymentUnit in interface DeploymentContext
Parameters:
unit - the deployment unit

setMetaDataPath

public void setMetaDataPath(String path)

getClassLoader

public ClassLoader getClassLoader()
Description copied from interface: DeploymentContext
Gets the classloader for this deployment unit

Specified by:
getClassLoader in interface DeploymentContext
Returns:
the classloader

setClassLoader

public void setClassLoader(ClassLoader classLoader)
Description copied from interface: DeploymentContext
Set the class loader

Specified by:
setClassLoader in interface DeploymentContext
Parameters:
classLoader - the new classloader

createClassLoader

public boolean createClassLoader(ClassLoaderFactory factory)
                          throws org.jboss.deployers.spi.DeploymentException
Description copied from interface: DeploymentContext
Create a classloader

Specified by:
createClassLoader in interface DeploymentContext
Parameters:
factory - the factory
Returns:
false if there is already is a classloader
Throws:
org.jboss.deployers.spi.DeploymentException - for any error

removeClassLoader

public void removeClassLoader()
Description copied from interface: DeploymentContext
Remove the classloader created by the factory

Specified by:
removeClassLoader in interface DeploymentContext

removeClassLoader

public void removeClassLoader(ClassLoaderFactory factory)
Description copied from interface: DeploymentContext
Remove the classloader

Specified by:
removeClassLoader in interface DeploymentContext
Parameters:
factory - the original factory used to create the classloader

isTopLevel

public boolean isTopLevel()
Description copied from interface: DeploymentContext
Whether this is a top level deployment

Specified by:
isTopLevel in interface DeploymentContext
Returns:
true when top level

getTopLevel

public DeploymentContext getTopLevel()
Description copied from interface: DeploymentContext
Get the top level deployment

Specified by:
getTopLevel in interface DeploymentContext
Returns:
the top level deployment

getParent

public DeploymentContext getParent()
Description copied from interface: DeploymentContext
The parent

Specified by:
getParent in interface DeploymentContext
Returns:
the parent

setParent

public void setParent(DeploymentContext parent)
Description copied from interface: DeploymentContext
Set the parent

Specified by:
setParent in interface DeploymentContext
Parameters:
parent - the parent

getChildren

public List<DeploymentContext> getChildren()
Description copied from interface: DeploymentContext
The children

Specified by:
getChildren in interface DeploymentContext
Returns:
the children

addChild

public void addChild(DeploymentContext child)
Description copied from interface: DeploymentContext
Add a child

Specified by:
addChild in interface DeploymentContext
Parameters:
child - the child to add

removeChild

public boolean removeChild(DeploymentContext child)
Description copied from interface: DeploymentContext
Remove a child

Specified by:
removeChild in interface DeploymentContext
Parameters:
child - the child to remove
Returns:
whether it was removed

getDeployment

public org.jboss.deployers.client.spi.Deployment getDeployment()
Description copied from interface: DeploymentContext
Get the deployment (if this is a top level context)

Specified by:
getDeployment in interface DeploymentContext
Returns:
the deployment

setDeployment

public void setDeployment(org.jboss.deployers.client.spi.Deployment deployment)
Description copied from interface: DeploymentContext
Set the deployment

Specified by:
setDeployment in interface DeploymentContext
Parameters:
deployment - the deployment

isComponent

public boolean isComponent()
Description copied from interface: DeploymentContext
Whether this is a component

Specified by:
isComponent in interface DeploymentContext
Returns:
true when a component

getComponents

public List<DeploymentContext> getComponents()
Description copied from interface: DeploymentContext
The components

Specified by:
getComponents in interface DeploymentContext
Returns:
the components

addComponent

public void addComponent(DeploymentContext component)
Description copied from interface: DeploymentContext
Add a component

Specified by:
addComponent in interface DeploymentContext
Parameters:
component - the componnet to add

removeComponent

public boolean removeComponent(DeploymentContext component)
Description copied from interface: DeploymentContext
Remove a component

Specified by:
removeComponent in interface DeploymentContext
Parameters:
component - the component to remove
Returns:
whether it was removed

getResourceClassLoader

public ClassLoader getResourceClassLoader()
Description copied from interface: DeploymentContext
Get a resource classloader

Specified by:
getResourceClassLoader in interface DeploymentContext
Returns:
the resource classloader loader

getResourceLoader

public DeploymentResourceLoader getResourceLoader()
Description copied from interface: DeploymentContext
Get a resource loader

Specified by:
getResourceLoader in interface DeploymentContext
Returns:
the resource loader

getDependencyInfo

public org.jboss.dependency.spi.DependencyInfo getDependencyInfo()
Description copied from interface: DeploymentContext
Get the dependency info

Specified by:
getDependencyInfo in interface DeploymentContext
Returns:
the dependency

visit

public void visit(DeploymentContextVisitor visitor)
           throws org.jboss.deployers.spi.DeploymentException
Description copied from interface: DeploymentContext
Visit the context and the children

Specified by:
visit in interface DeploymentContext
Parameters:
visitor - the visitor
Throws:
org.jboss.deployers.spi.DeploymentException - for any error in the visitor

getPredeterminedManagedObjects

public org.jboss.deployers.spi.attachments.Attachments getPredeterminedManagedObjects()
Specified by:
getPredeterminedManagedObjects in interface org.jboss.deployers.spi.attachments.PredeterminedManagedObjectAttachments

setPredeterminedManagedObjects

public void setPredeterminedManagedObjects(org.jboss.deployers.spi.attachments.Attachments objects)
Specified by:
setPredeterminedManagedObjects in interface org.jboss.deployers.spi.attachments.PredeterminedManagedObjectAttachments

getTransientManagedObjects

public org.jboss.deployers.spi.attachments.MutableAttachments getTransientManagedObjects()
Specified by:
getTransientManagedObjects in interface org.jboss.deployers.spi.attachments.ManagedObjectAttachments

getTransientAttachments

public org.jboss.deployers.spi.attachments.MutableAttachments getTransientAttachments()
Specified by:
getTransientAttachments in interface org.jboss.deployers.spi.attachments.ManagedObjectsWithTransientAttachments

getProblem

public Throwable getProblem()
Description copied from interface: DeploymentContext
Get the problem for this context

Specified by:
getProblem in interface DeploymentContext
Returns:
the problem

setProblem

public void setProblem(Throwable problem)
Description copied from interface: DeploymentContext
Set the problem for this context

Specified by:
setProblem in interface DeploymentContext
Parameters:
problem - the problem

deployed

public void deployed()
Description copied from interface: DeploymentContext
Touch the context to say it is deployed

Specified by:
deployed in interface DeploymentContext

isDeployed

public boolean isDeployed()
Description copied from interface: DeploymentContext
Whether the deployment was processed

Specified by:
isDeployed in interface DeploymentContext
Returns:
true when processed

cleanup

public void cleanup()
Description copied from interface: DeploymentContext
Cleanup the deployment context

Specified by:
cleanup in interface DeploymentContext

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2008 JBoss Inc.. All Rights Reserved.