org.jboss.deployers.vfs.spi.structure.helpers
Class AbstractStructureDeployer

java.lang.Object
  extended by org.jboss.deployers.vfs.spi.structure.helpers.AbstractStructureDeployer
All Implemented Interfaces:
org.jboss.deployers.spi.Ordered, StructureDeployer

public abstract class AbstractStructureDeployer
extends Object
implements StructureDeployer

AbstractStructureDeployer.

We don't care about the order by default.

Version:
$Revision: 1.1 $
Author:
Adrian Brock

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jboss.deployers.spi.Ordered
org.jboss.deployers.spi.Ordered.OrderedComparator
 
Field Summary
protected  org.jboss.logging.Logger log
          The log
 
Fields inherited from interface org.jboss.deployers.spi.Ordered
COMPARATOR
 
Constructor Summary
AbstractStructureDeployer()
           
 
Method Summary
protected  void addAllChildren(org.jboss.virtual.VirtualFile root, org.jboss.virtual.VirtualFile parent, org.jboss.deployers.spi.structure.StructureMetaData metaData, VFSStructuralDeployers deployers)
          Add all children as candidates
protected  void addChildren(org.jboss.virtual.VirtualFile root, org.jboss.virtual.VirtualFile parent, org.jboss.deployers.spi.structure.StructureMetaData metaData, VFSStructuralDeployers deployers, org.jboss.virtual.VisitorAttributes attributes)
          Add all children as candidates
protected  void addClassPath(org.jboss.virtual.VirtualFile root, org.jboss.virtual.VirtualFile entry, boolean includeEntry, boolean includeRootManifestCP, org.jboss.deployers.spi.structure.ContextInfo context)
          Add an entry to the context classpath.
protected  org.jboss.deployers.spi.structure.ContextInfo createContext(org.jboss.virtual.VirtualFile root, String metaDataPath, org.jboss.deployers.spi.structure.StructureMetaData structureMetaData)
          Create a context
 CandidateStructureVisitorFactory getCandidateStructureVisitorFactory()
          Get the candidateStructureVisitorFactory.
 int getRelativeOrder()
           
static String getRelativePath(org.jboss.virtual.VirtualFile parent, org.jboss.virtual.VirtualFile child)
          Get the relative path between two virtual files
protected  boolean isLeaf(org.jboss.virtual.VirtualFile file)
          Tests whether the virtual file is a leaf
 boolean isTopLevel(org.jboss.virtual.VirtualFile parent)
          See if a file corresponds to a top-level deployment.
 void setCandidateStructureVisitorFactory(CandidateStructureVisitorFactory candidateStructureVisitorFactory)
          Set the candidateStructureVisitorFactory.
 void setRelativeOrder(int order)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.deployers.vfs.spi.structure.StructureDeployer
determineStructure
 

Field Detail

log

protected org.jboss.logging.Logger log
The log

Constructor Detail

AbstractStructureDeployer

public AbstractStructureDeployer()
Method Detail

getRelativePath

public static final String getRelativePath(org.jboss.virtual.VirtualFile parent,
                                           org.jboss.virtual.VirtualFile child)
Get the relative path between two virtual files

Parameters:
parent - the parent
child - the child
Returns:
the relative path

getRelativeOrder

public int getRelativeOrder()
Specified by:
getRelativeOrder in interface org.jboss.deployers.spi.Ordered

setRelativeOrder

public void setRelativeOrder(int order)
Specified by:
setRelativeOrder in interface org.jboss.deployers.spi.Ordered

getCandidateStructureVisitorFactory

public CandidateStructureVisitorFactory getCandidateStructureVisitorFactory()
Get the candidateStructureVisitorFactory.

Returns:
the candidateStructureVisitorFactory.

setCandidateStructureVisitorFactory

public void setCandidateStructureVisitorFactory(CandidateStructureVisitorFactory candidateStructureVisitorFactory)
Set the candidateStructureVisitorFactory.

Parameters:
candidateStructureVisitorFactory - the candidateStructureVisitorFactory.
Throws:
IllegalArgumentException - for a null candidate structure

isTopLevel

public boolean isTopLevel(org.jboss.virtual.VirtualFile parent)
See if a file corresponds to a top-level deployment.

Parameters:
parent - the parent file
Returns:
true when top level

addClassPath

protected void addClassPath(org.jboss.virtual.VirtualFile root,
                            org.jboss.virtual.VirtualFile entry,
                            boolean includeEntry,
                            boolean includeRootManifestCP,
                            org.jboss.deployers.spi.structure.ContextInfo context)
                     throws IOException
Add an entry to the context classpath.

Parameters:
root - - the root file the classpath entry should be relative to
entry - - the candidate file to add as a classpath entry
includeEntry - - a flag indicating if the entry should be added to the classpath
includeRootManifestCP - - a flag indicating if the entry metainf manifest classpath should be included.
context - - the context to populate
Throws:
IOException - on any IO error

addAllChildren

protected void addAllChildren(org.jboss.virtual.VirtualFile root,
                              org.jboss.virtual.VirtualFile parent,
                              org.jboss.deployers.spi.structure.StructureMetaData metaData,
                              VFSStructuralDeployers deployers)
                       throws Exception
Add all children as candidates

Parameters:
root - the root context
parent - the parent context
metaData - the structure meta data
deployers - the structure deployers
Throws:
Exception - for any error

addChildren

protected void addChildren(org.jboss.virtual.VirtualFile root,
                           org.jboss.virtual.VirtualFile parent,
                           org.jboss.deployers.spi.structure.StructureMetaData metaData,
                           VFSStructuralDeployers deployers,
                           org.jboss.virtual.VisitorAttributes attributes)
                    throws Exception
Add all children as candidates

Parameters:
root - the root context
parent - the parent context
metaData - the structure meta data
deployers - the structure deployers
attributes - the visitor attributes uses VisitorAttributes.DEFAULT when null
Throws:
Exception - for any error

isLeaf

protected boolean isLeaf(org.jboss.virtual.VirtualFile file)
                  throws IOException
Tests whether the virtual file is a leaf

Parameters:
file - the virtual file
Returns:
true when it is a leaf
Throws:
IOException - for any error

createContext

protected org.jboss.deployers.spi.structure.ContextInfo createContext(org.jboss.virtual.VirtualFile root,
                                                                      String metaDataPath,
                                                                      org.jboss.deployers.spi.structure.StructureMetaData structureMetaData)
Create a context

Parameters:
root - the root context
metaDataPath - the metadata path
structureMetaData - the structure metadata
Returns:
the structure metadata
Throws:
IllegalArgumentException - for a null root or structure metaData


Copyright ? 2007 JBoss Inc.. All Rights Reserved.