org.jboss.deployers.structure.spi
Interface DeploymentUnit

All Superinterfaces:
Attachments, MutableAttachments, Serializable
All Known Subinterfaces:
VFSDeploymentUnit
All Known Implementing Classes:
AbstractDeploymentUnit, AbstractVFSDeploymentUnit

public interface DeploymentUnit
extends MutableAttachments

DeploymentUnit.

A deployment unit represents a single unit that deployers work with.

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

Method Summary
 DeploymentUnit addComponent(String name)
          Add a component
 void addControllerContextName(Object name)
          Add controller context name.
 void addIDependOn(org.jboss.dependency.spi.DependencyItem dependency)
          Add a dependency
 boolean createClassLoader(ClassLoaderFactory factory)
          Create the classloader
<T> Set<? extends T>
getAllMetaData(Class<T> type)
          Get all the metadata for the expected type
 List<DeploymentUnit> getChildren()
          Get the children
 ClassLoader getClassLoader()
          Gets the classloader for this deployment unit
 DeploymentUnit getComponent(String name)
          Get component.
 List<DeploymentUnit> getComponents()
          Get 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
 MainDeployer getMainDeployer()
          Get the main deployer
 org.jboss.metadata.spi.MetaData getMetaData()
          Get the metadata for this deployment unit
 org.jboss.metadata.spi.MutableMetaData getMutableMetaData()
          Get the mutable metadata for this deployment unit
 org.jboss.metadata.spi.scope.ScopeKey getMutableScope()
          Get the mutable scope
 String getName()
          Get the deployment units name
 DeploymentUnit getParent()
          Get the parent deployment unit
 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.
 DeploymentUnit getTopLevel()
          Get the top leve deployment unit
 MutableAttachments getTransientManagedObjects()
          Get the transient managed objects
 boolean isComponent()
          Whether this unit is a component
 boolean isTopLevel()
          Whether this unit is a top level deployment
 void removeClassLoader(ClassLoaderFactory factory)
          Remove the classloader
 boolean removeComponent(String name)
          Remove a component
 void removeControllerContextName(Object name)
          Remove controller context name.
 void removeIDependOn(org.jboss.dependency.spi.DependencyItem dependency)
          Remove a dependency
 void setMutableScope(org.jboss.metadata.spi.scope.ScopeKey key)
          Set the mutable scope
 void setRequiredStage(DeploymentStage stage)
          Set the required stage.
 void setScope(org.jboss.metadata.spi.scope.ScopeKey key)
          Set the scope
 void visit(DeploymentUnitVisitor visitor)
          Visit the unit and the children
 
Methods inherited from interface org.jboss.deployers.spi.attachments.MutableAttachments
addAttachment, addAttachment, addAttachment, clear, clearChangeCount, getChangeCount, removeAttachment, removeAttachment, removeAttachment, setAttachments
 
Methods inherited from interface org.jboss.deployers.spi.attachments.Attachments
getAttachment, getAttachment, getAttachment, getAttachments, hasAttachments, isAttachmentPresent, isAttachmentPresent, isAttachmentPresent
 

Method Detail

getName

String getName()
Get the deployment units name

Returns:
the name;

getSimpleName

String getSimpleName()
Get the simple vfs name of the deployment unit. This is the simple name of the virtual file . vfs path ------------------- simple name 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" deploy/complexwithappxml.ear/module-mbean1.sar/submbean.sar submbean.sar

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

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 unit

Returns:
the metadata

getMutableMetaData

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

Returns:
the metadata

getClassLoader

ClassLoader getClassLoader()
Gets the classloader for this deployment unit

Returns:
the classloader

createClassLoader

boolean createClassLoader(ClassLoaderFactory factory)
                          throws DeploymentException
Create the classloader

Parameters:
factory - the classloader factory
Returns:
false if the classloader already exists
Throws:
IllegalArgumentException - for a null factory
DeploymentException - for any error

removeClassLoader

void removeClassLoader(ClassLoaderFactory factory)
Remove the classloader

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

getAllMetaData

<T> Set<? extends T> getAllMetaData(Class<T> type)
Get all the metadata for the expected type

Type Parameters:
T - the type to get
Parameters:
type - the type
Returns:
a set of metadata matching the type
Throws:
IllegalArgumentException - if the type is null

getTransientManagedObjects

MutableAttachments getTransientManagedObjects()
Get the transient managed objects

Returns:
the managed objects

isTopLevel

boolean isTopLevel()
Whether this unit is a top level deployment

Returns:
true if a top level deployment

getTopLevel

DeploymentUnit getTopLevel()
Get the top leve deployment unit

Returns:
the top level deployment unit

getParent

DeploymentUnit getParent()
Get the parent deployment unit

Returns:
the parent or null if there is no parent

getChildren

List<DeploymentUnit> getChildren()
Get the children

Returns:
the children

getComponents

List<DeploymentUnit> getComponents()
Get the components

Returns:
the components

isComponent

boolean isComponent()
Whether this unit is a component

Returns:
true for a component

addComponent

DeploymentUnit addComponent(String name)
Add a component

Parameters:
name - the name
Returns:
the new deployment unit
Throws:
IllegalArgumentException - for a null name

getComponent

DeploymentUnit getComponent(String name)
Get component.

Parameters:
name - the name
Returns:
component if matching component exists, else null

removeComponent

boolean removeComponent(String name)
Remove a component

Parameters:
name - the name
Returns:
true when removed
Throws:
IllegalArgumentException - for a null name

getResourceLoader

DeploymentResourceLoader getResourceLoader()
Get a resource loader

Returns:
the resource loader

getResourceClassLoader

ClassLoader getResourceClassLoader()
Get a resource classloader

Returns:
the resource classloader loader

visit

void visit(DeploymentUnitVisitor visitor)
           throws DeploymentException
Visit the unit and the children

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

getMainDeployer

MainDeployer getMainDeployer()
Get the main deployer

Returns:
the deployer or null if not associated with a main deployer

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

addIDependOn

void addIDependOn(org.jboss.dependency.spi.DependencyItem dependency)
Add a dependency

Parameters:
dependency - the dependency to add

removeIDependOn

void removeIDependOn(org.jboss.dependency.spi.DependencyItem dependency)
Remove a dependency

Parameters:
dependency - the dependency to remove

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


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