|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.sape.carbon.core.config.node.AbstractNode | +--org.sape.carbon.core.config.node.AbstractFolder | +--org.sape.carbon.services.config.jar.JarFolder
Implementation of folder node for folders residing in Jars Copyright 2002 Sapient
Field Summary | |
private EnhancedJarFile |
currentOpenJar
reference to the currently openned jar |
private static String |
CVS_DIR
A CVS directory. |
private static Collection |
EXCLUDE_NODE_NAMES
Collection of node names that will not be loaded. |
private FileNodeFilter |
fileFilter
The filter used to obtain valid child entries that may be represented by JarNodes from the jarFile. |
static String |
JAR_DELIMETER
string that delimits entry names in the jar |
private String |
jarEntryName
name of the entry of this folder |
private File |
jarFile
reference to file containing the jar |
private boolean |
jarOpenForRead
flag to keep track of how the jar was openned: true for read, false for write |
private org.apache.commons.logging.Log |
log
Provides a handle to Apache-commons logger |
private static String |
META_INF_DIR
The java meta-inf directory. |
private ReadWriteLock |
readWriteLock
reference to the jar's monitor |
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 | |
JarFolder(Node parent,
String name,
NodeFactory subFolderFactory,
NodeFactory configurationDocumentFactory,
NodeFactory linkNodeFactory,
ReadWriteLock readWriteLock,
File jarFile,
String jarEntryName)
Constructor for JarFolder. |
Method Summary | |
protected boolean |
backingDataExists()
Method called from the refresh method to see if the backing data still exists. |
private void |
closeJar()
Closes the jar file if it is open, releasing the lock based upon how it was opened |
protected void |
destroyBackingData()
This implementation does nothing as jars have no concept of folders, so there is nothing to remove |
protected Set |
getAllChildNames()
This is sychronized because it is called from AbstractFolder.fetchAllChildren which is not synchronized, but the design of the class requires that openJar is not called multiple times without intervening calls to close jar |
(package private) String |
getInternalJarEntryName()
Returns the entry name of this node. |
(package private) File |
getInternalJarFile()
Returns the file object pointing to the jar file. |
(package private) ReadWriteLock |
getReadWriteLock()
Returns the monitor for this jar. |
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 |
private EnhancedJarFile |
openJar(boolean forRead)
Opens the jar file. |
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 |
private org.apache.commons.logging.Log log
private File jarFile
private String jarEntryName
private EnhancedJarFile currentOpenJar
private boolean jarOpenForRead
private final ReadWriteLock readWriteLock
private FileNodeFilter fileFilter
JarNodes
from the jarFile.
public static final String JAR_DELIMETER
private static final Collection EXCLUDE_NODE_NAMES
private static final String META_INF_DIR
private static final String CVS_DIR
Constructor Detail |
public JarFolder(Node parent, String name, NodeFactory subFolderFactory, NodeFactory configurationDocumentFactory, NodeFactory linkNodeFactory, ReadWriteLock readWriteLock, File jarFile, String jarEntryName)
parent
- the parent of this foldername
- the name of this foldersubFolderFactory
- the factory for creating sub foldersconfigurationDocumentFactory
- the factory for creating documentslinkNodeFactory
- the factory for creating sub linksreadWriteLock
- the monitor used to coordinate reads and writes
to the jarjarFile
- the file that is the jarjarEntryName
- the entry name within the jar that this node
representsMethod Detail |
protected Node loadChild(String nodeName) throws NodeNotFoundException
loadChild
in class AbstractNode
nodeName
- the name of the node to load
NodeNotFoundException
- if the backing data for the specifed
node could not be found in the data store.AbstractNode.loadChild(String)
protected Set getAllChildNames()
getAllChildNames
in class AbstractNode
String
s, the names of all the childrenAbstractNode.getAllChildNames()
protected void destroyBackingData() throws NodeRemovalException
destroyBackingData
in class AbstractNode
NodeRemovalException
- indicates an error removing the nodeAbstractNode.destroyBackingData()
protected boolean backingDataExists()
AbstractNode
backingDataExists
in class AbstractNode
AbstractNode.backingDataExists()
File getInternalJarFile()
String getInternalJarEntryName()
ReadWriteLock getReadWriteLock()
private Node loadSubFolder(String nodeName) throws NodeCreationException
nodeName
- the name of the sub-node
NodeCreationException
- indicates an error loading a subfolderprivate Node loadConfigurationDocument(String nodeName) throws NodeCreationException
nodeName
- name of the sub-config to load
NodeCreationException
- indicates an error loading the child
nodeprivate Node loadChildLinkNode(String nodeName) throws NodeCreationException
nodeName
- name of the child link node
NodeCreationException
- indicates an error loading the
child link nodeprivate EnhancedJarFile openJar(boolean forRead) throws IOException
forRead
- if true a read lock will be acquired, if false,
a write lock will be acquired
IOException
- indicates an error manipulating the jar fileprivate void closeJar() throws IOException
IOException
- indicates an error manipulating the jar file
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |