org.jboss.deployers.structure.spi
Interface DeploymentUnit

All Superinterfaces:
org.jboss.deployers.spi.attachments.Attachments, org.jboss.deployers.spi.attachments.MutableAttachments, Serializable
All Known Implementing Classes:
AbstractDeploymentUnit

public interface DeploymentUnit
extends org.jboss.deployers.spi.attachments.MutableAttachments

DeploymentUnit.

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

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

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
 List<DeploymentUnit> getComponents()
          Get the components
 Set<Object> getControllerContextNames()
          Get the controller context names.
 org.jboss.dependency.spi.DependencyInfo getDependencyInfo()
          Get the dependency info
 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
 org.jboss.deployers.spi.attachments.MutableAttachments getTransientManagedObjects()
          Get the transient managed objects
 Set<String> getTypes()
          Get the deployment types associated with this deployment.
 boolean isComponent()
          Whether this unit is a component
 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 setScope(org.jboss.metadata.spi.scope.ScopeKey key)
          Set the scope
 
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;

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 ------------------- 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

getTypes

Set<String> getTypes()
Get the deployment types associated with this deployment.

Returns:
set of deployment type names deployers have identified in this deployment.

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 org.jboss.deployers.spi.DeploymentException
Create the classloader

Parameters:
factory - the classloader factory
Returns:
false if the classloader already exists
Throws:
IllegalArgumentException - for a null factory
org.jboss.deployers.spi.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

org.jboss.deployers.spi.attachments.MutableAttachments getTransientManagedObjects()
Get the transient managed objects

Returns:
the managed objects

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

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

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


Copyright © 2008 JBoss Inc.. All Rights Reserved.