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

java.lang.Object
  extended by org.jboss.deployers.spi.attachments.helpers.PredeterminedManagedObjectAttachmentsImpl
      extended by org.jboss.deployers.spi.attachments.helpers.ManagedObjectAttachmentsImpl
          extended by org.jboss.deployers.spi.attachments.helpers.ManagedObjectsWithTransientAttachmentsImpl
              extended by org.jboss.deployers.structure.spi.helpers.AbstractDeploymentContext
All Implemented Interfaces:
Externalizable, Serializable, org.jboss.deployers.spi.attachments.ManagedObjectAttachments, org.jboss.deployers.spi.attachments.ManagedObjectsWithTransientAttachments, org.jboss.deployers.spi.attachments.PredeterminedManagedObjectAttachments, DeploymentContext

public class AbstractDeploymentContext
extends org.jboss.deployers.spi.attachments.helpers.ManagedObjectsWithTransientAttachmentsImpl
implements DeploymentContext

AbstractDeploymentContext.

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

Constructor Summary
AbstractDeploymentContext()
          For serialization
AbstractDeploymentContext(String name, String relativePath)
          Create a new AbstractDeploymentContext.
AbstractDeploymentContext(String name, String simpleName, String relativePath)
          Create a new AbstractDeploymentContext.
 
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
static void cleanupRepository(DeploymentContext deploymentContext)
          Cleanup the repository
 boolean createClassLoader(ClassLoaderFactory factory)
          Create a classloader
protected  DeploymentUnit createDeploymentUnit()
          Create a deployment unit
 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
static org.jboss.metadata.spi.MetaData getMetaData(DeploymentContext deploymentContext)
          Get the metadata for a deployment context
 org.jboss.metadata.spi.MutableMetaData getMutableMetaData()
          Get the mutable metadata for this deployment context
static org.jboss.metadata.spi.loader.MutableMetaDataLoader getMutableMetaData(DeploymentContext deploymentContext)
          Get the mutable metadata for a deployment context
 org.jboss.metadata.spi.scope.ScopeKey getMutableScope()
          Get the mutable scope
 String getName()
          Get the deployment name
 DeploymentContext getParent()
          The parent
 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"
static org.jboss.metadata.spi.repository.MutableMetaDataRepository getRepository(DeploymentContext deploymentContext)
          Get the repository for a deployment context
 ClassLoader getResourceClassLoader()
          Get a resource classloader
 DeploymentResourceLoader getResourceLoader()
          Get a resource loader
 org.jboss.metadata.spi.scope.ScopeKey getScope()
          Get the scope
static ScopeBuilder getScopeBuilder(DeploymentContext deploymentContext)
          Get the scope builder for a deployment context
 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
 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
 void readExternal(ObjectInput in)
           
 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 setMutableScope(org.jboss.metadata.spi.scope.ScopeKey mutableScope)
          Set the mutable scope
 void setParent(DeploymentContext parent)
          Set the parent
 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
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class org.jboss.deployers.spi.attachments.helpers.ManagedObjectsWithTransientAttachmentsImpl
getTransientAttachments
 
Methods inherited from class org.jboss.deployers.spi.attachments.helpers.ManagedObjectAttachmentsImpl
getTransientManagedObjects
 
Methods inherited from class org.jboss.deployers.spi.attachments.helpers.PredeterminedManagedObjectAttachmentsImpl
getPredeterminedManagedObjects, setPredeterminedManagedObjects
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jboss.deployers.spi.attachments.ManagedObjectsWithTransientAttachments
getTransientAttachments
 
Methods inherited from interface org.jboss.deployers.spi.attachments.ManagedObjectAttachments
getTransientManagedObjects
 
Methods inherited from interface org.jboss.deployers.spi.attachments.PredeterminedManagedObjectAttachments
getPredeterminedManagedObjects, setPredeterminedManagedObjects
 

Constructor Detail

AbstractDeploymentContext

public AbstractDeploymentContext()
For serialization


AbstractDeploymentContext

public AbstractDeploymentContext(String name,
                                 String relativePath)
Create a new AbstractDeploymentContext.

Parameters:
name - the name
relativePath - the relative path to the top of the deployment
Throws:
IllegalArgumentException - if the name is null

AbstractDeploymentContext

public AbstractDeploymentContext(String name,
                                 String simpleName,
                                 String relativePath)
Create a new AbstractDeploymentContext.

Parameters:
name - the name
simpleName - the simple name
relativePath - the relative path to the top of the deployment
Throws:
IllegalArgumentException - if the name is null
Method Detail

getScopeBuilder

public static ScopeBuilder getScopeBuilder(DeploymentContext deploymentContext)
Get the scope builder for a deployment context

Parameters:
deploymentContext - the deployment context
Returns:
the scope builder

getRepository

public static org.jboss.metadata.spi.repository.MutableMetaDataRepository getRepository(DeploymentContext deploymentContext)
Get the repository for a deployment context

Parameters:
deploymentContext - the deployment context
Returns:
the repository

cleanupRepository

public static void cleanupRepository(DeploymentContext deploymentContext)
Cleanup the repository

Parameters:
deploymentContext - the deployment context

getMetaData

public static org.jboss.metadata.spi.MetaData getMetaData(DeploymentContext deploymentContext)
Get the metadata for a deployment context

Parameters:
deploymentContext - the deployment context
Returns:
the metaData

getMutableMetaData

public static org.jboss.metadata.spi.loader.MutableMetaDataLoader getMutableMetaData(DeploymentContext deploymentContext)
Get the mutable metadata for a deployment context

Parameters:
deploymentContext - the deployment context
Returns:
the metaData

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

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

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

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

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

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

isDeployed

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

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

deployed

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

Specified by:
deployed in interface DeploymentContext

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

createDeploymentUnit

protected DeploymentUnit createDeploymentUnit()
Create a deployment unit

Returns:
the deployment unit

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Overrides:
readExternal in class org.jboss.deployers.spi.attachments.helpers.ManagedObjectsWithTransientAttachmentsImpl
Throws:
IOException
ClassNotFoundException

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Overrides:
writeExternal in class org.jboss.deployers.spi.attachments.helpers.ManagedObjectsWithTransientAttachmentsImpl
Parameters:
out - the output
Throws:
IOException - for any error


Copyright © 2008 JBoss Inc.. All Rights Reserved.