org.sape.carbon.services.config.classloader
Class ClassloaderFolder

java.lang.Object
  |
  +--org.sape.carbon.core.config.node.AbstractNode
        |
        +--org.sape.carbon.core.config.node.AbstractFolder
              |
              +--org.sape.carbon.services.config.classloader.ClassloaderFolder
All Implemented Interfaces:
Folder, Node

public class ClassloaderFolder
extends AbstractFolder

Implementation of folder node for folders residing in classloader. As classloaders have no notion of folders, these nodes are not actually backed by information contained in the classloader. Copyright 2003 Sapient

Since:
carbon 2.0
Version:
$Revision: 1.7 $($Author: dvoet $ / $Date: 2003/11/11 21:19:58 $)
Author:
Greg Hinkle, April 2003

Field Summary
static String CLASSLOADER_DELIMETER
          string that delimits entry names in the jar
private  ConfigurationSource configSource
           
private static String CVS_DIR
           
private static Collection EXCLUDE_NODE_NAMES
           
private  FileNodeFilter fileFilter
          The filter used to obtain valid child entries that may be represented by JarNodes from the jarFile.
private  org.apache.commons.logging.Log log
          Provides a handle to Apache-commons logger
private static String META_INF_DIR
           
private  String resourcePath
          the full resource path of this folder
 
Fields inherited from class org.sape.carbon.core.config.node.AbstractFolder
 
Fields inherited from class org.sape.carbon.core.config.node.AbstractNode
childNodes, nodeListeners
 
Fields inherited from interface org.sape.carbon.core.config.node.Node
DELIMITER
 
Constructor Summary
ClassloaderFolder(Node parent, String name, NodeFactory subFolderFactory, NodeFactory configurationDocumentFactory, NodeFactory linkNodeFactory, String resourcePath, ConfigurationSource configSource)
          Constructor for JarFolder.
 
Method Summary
protected  boolean backingDataExists()
          As backing data never exists for classloader folders, the very existance of an instance of this class means the folder exists
protected  void destroyBackingData()
          This implementation does nothing as classloaders have no concept of folders, so there is nothing to remove
protected  Set getAllChildNames()
          There is no way to traverse the resources in the classloader to get all the children, so this implementation returns no children
(package private)  ConfigurationSource getConfigSource()
           
(package private)  String getResourcePath()
          Returns the entry name of this node.
protected  Node loadChild(String nodeName)
          This is not synchronized because it is called from AbstractFolder.fetchChild which is synchronized
private  Node loadChildLinkNode(String nodeName)
          Helper method used to create sub links
private  Node loadConfigurationDocument(String nodeName)
          Helper method used to create sub config docs
private  Node loadSubFolder(String nodeName)
          Helper method used to create sub folders
 
Methods inherited from class org.sape.carbon.core.config.node.AbstractFolder
addConfigurationDocument, addLink, addSubFolder, createNewConfigurationDocument, createNewFolder, getConfigurationDocumentFactory, getLinkNodeFactory, getSubFolderFactory, issueChildAddedEvent
 
Methods inherited from class org.sape.carbon.core.config.node.AbstractNode
addNodeListener, addNodeListener, addNodeListener, containsChild, fetchChild, fetchChildren, getAbsoluteName, getAddOrLoadChildLock, getAllowsChildren, getName, getParent, getReadOrAlterNodeLock, isRemoved, issueChildLoadedEvent, issueNodeRemovedEvent, refresh, remove, removeRemovedChildren, setRemoved, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.sape.carbon.core.config.node.Node
addNodeListener, addNodeListener, containsChild, fetchChild, fetchChildren, getAbsoluteName, getAllowsChildren, getName, getParent, isRemoved, refresh, remove
 

Field Detail

log

private org.apache.commons.logging.Log log
Provides a handle to Apache-commons logger


resourcePath

private String resourcePath
the full resource path of this folder


fileFilter

private FileNodeFilter fileFilter
The filter used to obtain valid child entries that may be represented by JarNodes from the jarFile.


configSource

private ConfigurationSource configSource

CLASSLOADER_DELIMETER

public static final String CLASSLOADER_DELIMETER
string that delimits entry names in the jar

See Also:
Constant Field Values

EXCLUDE_NODE_NAMES

private static final Collection EXCLUDE_NODE_NAMES

META_INF_DIR

private static final String META_INF_DIR
See Also:
Constant Field Values

CVS_DIR

private static final String CVS_DIR
See Also:
Constant Field Values
Constructor Detail

ClassloaderFolder

public ClassloaderFolder(Node parent,
                         String name,
                         NodeFactory subFolderFactory,
                         NodeFactory configurationDocumentFactory,
                         NodeFactory linkNodeFactory,
                         String resourcePath,
                         ConfigurationSource configSource)
Constructor for JarFolder.

Parameters:
parent - the parent of this folder
name - the name of this folder
subFolderFactory - the factory for creating sub folders
configurationDocumentFactory - the factory for creating documents
linkNodeFactory - the factory for creating sub links
resourcePath -
Method Detail

loadChild

protected Node loadChild(String nodeName)
                  throws NodeNotFoundException
This is not synchronized because it is called from AbstractFolder.fetchChild which is synchronized

Specified by:
loadChild in class AbstractNode
Parameters:
nodeName - the name of the node to load
Returns:
Node the loaded node
Throws:
NodeNotFoundException - if the backing data for the specifed node could not be found in the data store.
See Also:
AbstractNode.loadChild(String)

getAllChildNames

protected Set getAllChildNames()
There is no way to traverse the resources in the classloader to get all the children, so this implementation returns no children

Specified by:
getAllChildNames in class AbstractNode
Returns:
Set of Strings, the names of all the children
See Also:
AbstractNode.getAllChildNames()

destroyBackingData

protected void destroyBackingData()
                           throws NodeRemovalException
This implementation does nothing as classloaders have no concept of folders, so there is nothing to remove

Specified by:
destroyBackingData in class AbstractNode
Throws:
NodeRemovalException - indicates an error removing the node
See Also:
AbstractNode.destroyBackingData()

backingDataExists

protected boolean backingDataExists()
As backing data never exists for classloader folders, the very existance of an instance of this class means the folder exists

Specified by:
backingDataExists in class AbstractNode
Returns:
true

getResourcePath

String getResourcePath()
Returns the entry name of this node. Called by factories to preprend to resourcePaths of child nodes

Returns:
String

getConfigSource

ConfigurationSource getConfigSource()

loadSubFolder

private Node loadSubFolder(String nodeName)
                    throws NodeCreationException
Helper method used to create sub folders

Parameters:
nodeName -
Returns:
Node
Throws:
NodeCreationException

loadConfigurationDocument

private Node loadConfigurationDocument(String nodeName)
                                throws NodeCreationException
Helper method used to create sub config docs

Parameters:
nodeName -
Returns:
Node
Throws:
NodeCreationException

loadChildLinkNode

private Node loadChildLinkNode(String nodeName)
                        throws NodeCreationException
Helper method used to create sub links

Parameters:
nodeName -
Returns:
Node
Throws:
NodeCreationException


Copyright 1999-2003 Sapient Corporation. All Rights Reserved.