org.jboss.deployers.vfs.plugins.structure
Class AbstractVFSDeploymentContext

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
                  extended by org.jboss.deployers.vfs.plugins.structure.AbstractVFSDeploymentContext
All Implemented Interfaces:
Externalizable, Serializable, MBeanRegistration, ManagedObjectAttachments, ManagedObjectsWithTransientAttachments, PredeterminedManagedObjectAttachments, DeploymentContext, DeploymentMBean, AbstractDeploymentContextMBean, AbstractVFSDeploymentContextMBean, VFSDeploymentContext

public class AbstractVFSDeploymentContext
extends AbstractDeploymentContext
implements VFSDeploymentContext, AbstractVFSDeploymentContextMBean

AbstractVFSDeploymentContext.

Version:
$Revision: 1.1 $
Author:
Adrian Brock, Ales Justin
See Also:
Serialized Form

Constructor Summary
AbstractVFSDeploymentContext()
          For serialization
AbstractVFSDeploymentContext(String name, String simpleName, org.jboss.virtual.VirtualFile root, String relativePath)
          Create a new AbstractVFSDeploymentContext.
AbstractVFSDeploymentContext(org.jboss.virtual.VirtualFile root, String relativePath)
          Create a new AbstractVFSDeploymentContext.
 
Method Summary
 void appendClassPath(List<org.jboss.virtual.VirtualFile> files)
          Add virtual files to the classpath
 void appendClassPath(org.jboss.virtual.VirtualFile... files)
          Append virtual files to the classpath
 void appendMetaDataLocation(org.jboss.virtual.VirtualFile... locations)
          Append metadata file locations.
 void cleanup()
          Cleanup the deployment context
protected  DeploymentUnit createDeploymentUnit()
          Create a deployment unit
 List<org.jboss.virtual.VirtualFile> getClassPath()
          Get the class path
 org.jboss.virtual.VirtualFile getFile(String name)
          Gets a file from this deployment
 org.jboss.virtual.VirtualFile getMetaDataFile(String name)
          Gets a metadata file
 List<org.jboss.virtual.VirtualFile> getMetaDataFiles(String name, String suffix)
          Gets metadata files for this deployment
 List<org.jboss.virtual.VirtualFile> getMetaDataFiles(org.jboss.virtual.VirtualFileFilter filter)
          Gets the metadata files for this deployment unit
 List<org.jboss.virtual.VirtualFile> getMetaDataLocations()
          Get the meta data locations
protected  List<org.jboss.virtual.VirtualFile> getMutableClassPath()
          Get mutable classpath.
protected  List<org.jboss.virtual.VirtualFile> getMutableMetaDataLocations()
          Get mutable metadata locations.
 VFSDeploymentResourceLoader getResourceLoader()
          Get a resource loader
 org.jboss.virtual.VirtualFile getRoot()
          Get the root file
 VFSDeploymentContext getTopLevel()
          Get the top level deployment
 void prependClassPath(List<org.jboss.virtual.VirtualFile> files)
          Prepend virtual files to the classpath
 void prependClassPath(org.jboss.virtual.VirtualFile... files)
          Prepend virtual files to the classpath
 void prependMetaDataLocation(org.jboss.virtual.VirtualFile... locations)
          Prepend metadata file locations.
 void readExternal(ObjectInput in)
           
 void removeClassPath(org.jboss.virtual.VirtualFile... files)
          Remove classpath files.
 void removeMetaDataLocation(org.jboss.virtual.VirtualFile... locations)
          Remove metadata file locations.
protected  org.jboss.virtual.VirtualFile searchMetaDataLocations(String name)
          Search the metadata locations.
 void setClassPath(List<org.jboss.virtual.VirtualFile> paths)
          Set the class path
 void setMetaDataLocations(List<org.jboss.virtual.VirtualFile> locations)
          Set the meta data locations
 void setMetaDataPath(List<String> paths)
          Set the meta data path relative to the root
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class org.jboss.deployers.structure.spi.helpers.AbstractDeploymentContext
addChild, addComponent, addControllerContextName, cleanupRepository, createClassLoader, deployed, getChildNames, getChildren, getClassLoader, getClassLoaderName, getComparator, getComponentNames, getComponents, getControllerContextName, getControllerContextNames, getDependencyInfo, getDeployment, getDeploymentUnit, getMetaData, getMetaData, getMutableMetaData, getMutableMetaData, getMutableScope, getName, getObjectName, getParent, getParentName, getProblem, getRelativeOrder, getRelativePath, getRepository, getResourceClassLoader, getScope, getScopeBuilder, getSimpleName, getState, getTopLevelName, getTransientAttachments, getTransientManagedObjects, isComponent, isDeployed, isTopLevel, listAttachments, listAttachments, postDeregister, postRegister, preDeregister, preRegister, registerMBeans, removeChild, removeClassLoader, removeClassLoader, removeComponent, removeControllerContextName, setClassLoader, setComparator, setDeployment, setDeploymentUnit, setMutableScope, setParent, setProblem, setRelativeOrder, setRequiredStage, setScope, setState, toString, unregisterMBeans, visit
 
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.structure.spi.DeploymentContext
addChild, addComponent, addControllerContextName, createClassLoader, deployed, getChildren, getClassLoader, getComparator, getComponents, getControllerContextName, getControllerContextNames, getDependencyInfo, getDeployment, getDeploymentUnit, getMetaData, getMutableMetaData, getMutableScope, getName, getParent, getProblem, getRelativeOrder, getRelativePath, getResourceClassLoader, getScope, getSimpleName, getState, isComponent, isDeployed, isTopLevel, removeChild, removeClassLoader, removeClassLoader, removeComponent, removeControllerContextName, setClassLoader, setComparator, setDeployment, setDeploymentUnit, setMutableScope, setParent, setProblem, setRelativeOrder, setRequiredStage, setScope, setState, visit
 
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
 
Methods inherited from interface org.jboss.deployers.structure.spi.helpers.AbstractDeploymentContextMBean
listAttachments
 
Methods inherited from interface org.jboss.deployers.structure.spi.DeploymentMBean
getChildNames, getClassLoaderName, getComparator, getComponentNames, getControllerContextNames, getDependencyInfo, getMutableScope, getName, getObjectName, getParentName, getProblem, getRelativeOrder, getRelativePath, getScope, getSimpleName, getState, getTopLevelName, isComponent, isDeployed, isTopLevel
 

Constructor Detail

AbstractVFSDeploymentContext

public AbstractVFSDeploymentContext()
For serialization


AbstractVFSDeploymentContext

public AbstractVFSDeploymentContext(String name,
                                    String simpleName,
                                    org.jboss.virtual.VirtualFile root,
                                    String relativePath)
Create a new AbstractVFSDeploymentContext.

Parameters:
name - the name
simpleName - the simple name
root - the virtual file
relativePath - the relative path

AbstractVFSDeploymentContext

public AbstractVFSDeploymentContext(org.jboss.virtual.VirtualFile root,
                                    String relativePath)
Create a new AbstractVFSDeploymentContext.

Parameters:
root - the virtual file
relativePath - the relative path
Method Detail

getRoot

public org.jboss.virtual.VirtualFile getRoot()
Description copied from interface: VFSDeploymentContext
Get the root file

Specified by:
getRoot in interface AbstractVFSDeploymentContextMBean
Specified by:
getRoot in interface VFSDeploymentContext
Returns:
the root

setMetaDataPath

public void setMetaDataPath(List<String> paths)
Description copied from interface: VFSDeploymentContext
Set the meta data path relative to the root

Specified by:
setMetaDataPath in interface VFSDeploymentContext
Parameters:
paths - the path

getMutableMetaDataLocations

protected List<org.jboss.virtual.VirtualFile> getMutableMetaDataLocations()
Get mutable metadata locations.

Returns:
the mutable metadata locations

getMetaDataLocations

public List<org.jboss.virtual.VirtualFile> getMetaDataLocations()
Description copied from interface: VFSDeploymentContext
Get the meta data locations

Specified by:
getMetaDataLocations in interface AbstractVFSDeploymentContextMBean
Specified by:
getMetaDataLocations in interface VFSDeploymentContext
Returns:
the meta data locations

setMetaDataLocations

public void setMetaDataLocations(List<org.jboss.virtual.VirtualFile> locations)
Description copied from interface: VFSDeploymentContext
Set the meta data locations

Specified by:
setMetaDataLocations in interface VFSDeploymentContext
Parameters:
locations - the meta data location

getMetaDataFile

public org.jboss.virtual.VirtualFile getMetaDataFile(String name)
Description copied from interface: VFSDeploymentContext
Gets a metadata file

Specified by:
getMetaDataFile in interface VFSDeploymentContext
Parameters:
name - the name to exactly match
Returns:
the virtual file or null if not found

searchMetaDataLocations

protected org.jboss.virtual.VirtualFile searchMetaDataLocations(String name)
Search the metadata locations. In this impl the first one matching is returned.

Parameters:
name - the file name to find
Returns:
found file or null if not found

getMetaDataFiles

public List<org.jboss.virtual.VirtualFile> getMetaDataFiles(String name,
                                                            String suffix)
Description copied from interface: VFSDeploymentContext
Gets metadata files for this deployment

Specified by:
getMetaDataFiles in interface VFSDeploymentContext
Parameters:
name - the name to exactly match
suffix - the suffix to partially match
Returns:
the virtual files that match

getMetaDataFiles

public List<org.jboss.virtual.VirtualFile> getMetaDataFiles(org.jboss.virtual.VirtualFileFilter filter)
Description copied from interface: VFSDeploymentContext
Gets the metadata files for this deployment unit

Specified by:
getMetaDataFiles in interface VFSDeploymentContext
Parameters:
filter - the file filter
Returns:
the virtual files that match

prependMetaDataLocation

public void prependMetaDataLocation(org.jboss.virtual.VirtualFile... locations)
Description copied from interface: VFSDeploymentContext
Prepend metadata file locations.

Specified by:
prependMetaDataLocation in interface VFSDeploymentContext
Parameters:
locations - the locations

appendMetaDataLocation

public void appendMetaDataLocation(org.jboss.virtual.VirtualFile... locations)
Description copied from interface: VFSDeploymentContext
Append metadata file locations.

Specified by:
appendMetaDataLocation in interface VFSDeploymentContext
Parameters:
locations - the locations

removeMetaDataLocation

public void removeMetaDataLocation(org.jboss.virtual.VirtualFile... locations)
Description copied from interface: VFSDeploymentContext
Remove metadata file locations.

Specified by:
removeMetaDataLocation in interface VFSDeploymentContext
Parameters:
locations - the locations

getFile

public org.jboss.virtual.VirtualFile getFile(String name)
Description copied from interface: VFSDeploymentContext
Gets a file from this deployment

Specified by:
getFile in interface VFSDeploymentContext
Parameters:
name - the name to exactly match
Returns:
the file or null if not found

getMutableClassPath

protected List<org.jboss.virtual.VirtualFile> getMutableClassPath()
Get mutable classpath.

Returns:
the mutable classpath

getClassPath

public List<org.jboss.virtual.VirtualFile> getClassPath()
Description copied from interface: VFSDeploymentContext
Get the class path

Specified by:
getClassPath in interface AbstractVFSDeploymentContextMBean
Specified by:
getClassPath in interface VFSDeploymentContext
Returns:
the class path

setClassPath

public void setClassPath(List<org.jboss.virtual.VirtualFile> paths)
Description copied from interface: VFSDeploymentContext
Set the class path

Specified by:
setClassPath in interface VFSDeploymentContext
Parameters:
paths - the paths

appendClassPath

public void appendClassPath(List<org.jboss.virtual.VirtualFile> files)
Description copied from interface: VFSDeploymentContext
Add virtual files to the classpath

Specified by:
appendClassPath in interface VFSDeploymentContext
Parameters:
files - a virtual file

prependClassPath

public void prependClassPath(org.jboss.virtual.VirtualFile... files)
Description copied from interface: VFSDeploymentContext
Prepend virtual files to the classpath

Specified by:
prependClassPath in interface VFSDeploymentContext
Parameters:
files - a virtual file

prependClassPath

public void prependClassPath(List<org.jboss.virtual.VirtualFile> files)
Description copied from interface: VFSDeploymentContext
Prepend virtual files to the classpath

Specified by:
prependClassPath in interface VFSDeploymentContext
Parameters:
files - a virtual file

appendClassPath

public void appendClassPath(org.jboss.virtual.VirtualFile... files)
Description copied from interface: VFSDeploymentContext
Append virtual files to the classpath

Specified by:
appendClassPath in interface VFSDeploymentContext
Parameters:
files - a virtual file

removeClassPath

public void removeClassPath(org.jboss.virtual.VirtualFile... files)
Description copied from interface: VFSDeploymentContext
Remove classpath files.

Specified by:
removeClassPath in interface VFSDeploymentContext
Parameters:
files - the files

getTopLevel

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

Specified by:
getTopLevel in interface DeploymentContext
Specified by:
getTopLevel in interface VFSDeploymentContext
Overrides:
getTopLevel in class AbstractDeploymentContext
Returns:
the top level deployment

getResourceLoader

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

Specified by:
getResourceLoader in interface DeploymentContext
Specified by:
getResourceLoader in interface VFSDeploymentContext
Overrides:
getResourceLoader in class AbstractDeploymentContext
Returns:
the resource loader

createDeploymentUnit

protected DeploymentUnit createDeploymentUnit()
Description copied from class: AbstractDeploymentContext
Create a deployment unit

Overrides:
createDeploymentUnit in class AbstractDeploymentContext
Returns:
the deployment unit

cleanup

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

Specified by:
cleanup in interface DeploymentContext
Overrides:
cleanup in class AbstractDeploymentContext

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Overrides:
readExternal in class AbstractDeploymentContext
Throws:
IOException
ClassNotFoundException

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Overrides:
writeExternal in class AbstractDeploymentContext
Parameters:
out - the output
Throws:
IOException - for any error


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