org.jboss.deployers.structure.spi
Interface DeploymentContext

All Superinterfaces:
ManagedObjectAttachments, ManagedObjectsWithTransientAttachments, PredeterminedManagedObjectAttachments, Serializable
All Known Subinterfaces:
VFSDeploymentContext
All Known Implementing Classes:
AbstractDeploymentContext, AbstractVFSDeploymentContext, ComponentDeploymentContext

public interface DeploymentContext
extends ManagedObjectsWithTransientAttachments

DeploymentContext.

Version:
$Revision: 59630 $
Author:
Adrian Brock, Scott.Stark@jboss.org, Ales Justin

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
 Object getControllerContextName()
          Get underlying controller context name.
 Set<Object> getControllerContextNames()
          Get the controller context names.
 org.jboss.dependency.spi.DependencyInfo getDependencyInfo()
          Get the dependency info
 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
 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.
 DeploymentState getState()
          Get the deployment state
 DeploymentContext getTopLevel()
          Get the top level 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(Deployment deployment)
          Set the deployment
 void setDeploymentUnit(DeploymentUnit unit)
          Set the deployment unit
 void setMutableScope(org.jboss.metadata.spi.scope.ScopeKey key)
          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 setRequiredStage(DeploymentStage stage)
          Set the required stage.
 void setScope(org.jboss.metadata.spi.scope.ScopeKey key)
          Set the scope
 void setState(DeploymentState state)
          Set the deployment state
 void visit(DeploymentContextVisitor visitor)
          Visit the context and the children
 
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
 

Method Detail

getName

String getName()
Get the deployment name

Returns:
the name

getControllerContextNames

Set<Object> getControllerContextNames()
Get the controller context names.

Returns:
the names

addControllerContextName

void addControllerContextName(Object name)
Add controller context name.

Parameters:
name - the controller context name

removeControllerContextName

void removeControllerContextName(Object name)
Remove controller context name.

Parameters:
name - the controller context name

getSimpleName

String getSimpleName()
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"

Returns:
the deployment unit simple path

getRelativePath

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"

Returns:
the top-level deployment relative path

getRelativeOrder

int getRelativeOrder()
Get the relative order

Returns:
the relative order

setRelativeOrder

void setRelativeOrder(int relativeOrder)
Set the relative order

Parameters:
relativeOrder - the relativeOrder

getComparator

Comparator<DeploymentContext> getComparator()
Get the comparator.

Returns:
the comparator.

setComparator

void setComparator(Comparator<DeploymentContext> comparator)
Set the comparator.

Parameters:
comparator - the comparator.

getScope

org.jboss.metadata.spi.scope.ScopeKey getScope()
Get the scope

Returns:
the scope

setScope

void setScope(org.jboss.metadata.spi.scope.ScopeKey key)
Set the scope

Parameters:
key - the scope key

getMutableScope

org.jboss.metadata.spi.scope.ScopeKey getMutableScope()
Get the mutable scope

Returns:
the mutable scope

setMutableScope

void setMutableScope(org.jboss.metadata.spi.scope.ScopeKey key)
Set the mutable scope

Parameters:
key - the mutable scope key

getMetaData

org.jboss.metadata.spi.MetaData getMetaData()
Get the metadata for this deployment context

Returns:
the metadata

getMutableMetaData

org.jboss.metadata.spi.MutableMetaData getMutableMetaData()
Get the mutable metadata for this deployment context

Returns:
the metadata

getState

DeploymentState getState()
Get the deployment state

Returns:
the state

setState

void setState(DeploymentState state)
Set the deployment state

Parameters:
state - the state

getDeployment

Deployment getDeployment()
Get the deployment (if this is a top level context)

Returns:
the deployment

setDeployment

void setDeployment(Deployment deployment)
Set the deployment

Parameters:
deployment - the deployment
Throws:
IllegalArgumentException - for a null deployment

getDeploymentUnit

DeploymentUnit getDeploymentUnit()
Get the deployment unit

Returns:
the deployment

setDeploymentUnit

void setDeploymentUnit(DeploymentUnit unit)
Set the deployment unit

Parameters:
unit - the deployment unit

getClassLoader

ClassLoader getClassLoader()
Gets the classloader for this deployment unit

Returns:
the classloader

setClassLoader

void setClassLoader(ClassLoader classLoader)
Set the class loader

Parameters:
classLoader - the new classloader

createClassLoader

boolean createClassLoader(ClassLoaderFactory factory)
                          throws DeploymentException
Create a classloader

Parameters:
factory - the factory
Returns:
false if there is already is a classloader
Throws:
DeploymentException - for any error

removeClassLoader

void removeClassLoader()
Remove the classloader created by the factory


removeClassLoader

void removeClassLoader(ClassLoaderFactory factory)
Remove the classloader

Parameters:
factory - the original factory used to create the classloader

isTopLevel

boolean isTopLevel()
Whether this is a top level deployment

Returns:
true when top level

getTopLevel

DeploymentContext getTopLevel()
Get the top level deployment

Returns:
the top level deployment

getParent

DeploymentContext getParent()
The parent

Returns:
the parent

setParent

void setParent(DeploymentContext parent)
Set the parent

Parameters:
parent - the parent

getChildren

List<DeploymentContext> getChildren()
The children

Returns:
the children

addChild

void addChild(DeploymentContext child)
Add a child

Parameters:
child - the child to add

removeChild

boolean removeChild(DeploymentContext child)
Remove a child

Parameters:
child - the child to remove
Returns:
whether it was removed

isComponent

boolean isComponent()
Whether this is a component

Returns:
true when a component

getComponents

List<DeploymentContext> getComponents()
The components

Returns:
the components

addComponent

void addComponent(DeploymentContext component)
Add a component

Parameters:
component - the componnet to add

removeComponent

boolean removeComponent(DeploymentContext component)
Remove a component

Parameters:
component - the component to remove
Returns:
whether it was removed

getResourceLoader

DeploymentResourceLoader getResourceLoader()
Get a resource loader

Returns:
the resource loader

getResourceClassLoader

ClassLoader getResourceClassLoader()
Get a resource classloader

Returns:
the resource classloader loader

getControllerContextName

Object getControllerContextName()
Get underlying controller context name.

Returns:
the controller context name

setRequiredStage

void setRequiredStage(DeploymentStage stage)
Set the required stage.

Parameters:
stage - the required stage

getDependencyInfo

org.jboss.dependency.spi.DependencyInfo getDependencyInfo()
Get the dependency info

Returns:
the dependency

visit

void visit(DeploymentContextVisitor visitor)
           throws DeploymentException
Visit the context and the children

Parameters:
visitor - the visitor
Throws:
DeploymentException - for any error in the visitor
IllegalArgumentException - for a null visitor

isDeployed

boolean isDeployed()
Whether the deployment was processed

Returns:
true when processed

deployed

void deployed()
Touch the context to say it is deployed


getProblem

Throwable getProblem()
Get the problem for this context

Returns:
the problem

setProblem

void setProblem(Throwable problem)
Set the problem for this context

Parameters:
problem - the problem

cleanup

void cleanup()
Cleanup the deployment context



Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.