|
|||||||||||
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
This implementation of the Folder
interface caches its
children as they are requested. This implementation interfaces with the
backing data store through sub-classes implementing the methods
loadChild
and getAllChildNames
.
Copyright 2002 Sapient
Field Summary | |
private NodeFactory |
configurationDocumentFactory
factory used to construct all ConfigurationDocuments within this folder. |
private NodeFactory |
linkNodeFactory
factory used to construct all LinkNodes within this folder. |
private NodeFactory |
subFolderFactory
Factory used to construct all Folders within this folder. |
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 | |
AbstractFolder(Node parent,
String name,
NodeFactory subFolderFactory,
NodeFactory configurationDocumentFactory,
NodeFactory linkNodeFactory)
Constructor for AbstractFolder. |
|
AbstractFolder(Node parent,
String name,
Object readOrAlterNodeLock,
Object addOrLoadChildLock,
NodeFactory subFolderFactory,
NodeFactory configurationDocumentFactory,
NodeFactory linkNodeFactory)
Constructor for AbstractFolder. |
Method Summary | |
ConfigurationDocument |
addConfigurationDocument(String name,
Configuration config)
Creates a new child ConfigurationDocument and returns a
reference to the newly created ConfigurationDocument . |
LinkNode |
addLink(String name,
LinkNodeConfiguration linkConfiguration)
Adds a link to the folder. |
Folder |
addSubFolder(String name)
Creates a new child Folder and returns a reference to
the newly created Folder . |
protected ConfigurationDocument |
createNewConfigurationDocument(String name,
Configuration config)
Uses the configurationDocumentFactory to create a child ConfigurationDocument and adds it to childNodes. |
protected Folder |
createNewFolder(String name)
Uses the subFolderFactory to create a child Folder and
adds it to childNodes |
NodeFactory |
getConfigurationDocumentFactory()
Gets the factory this node used in the addConfigurationDocument
method to create children. |
NodeFactory |
getLinkNodeFactory()
Gets the factory this node used in the addLinkNode
method to create children. |
NodeFactory |
getSubFolderFactory()
Gets the factory this node used in the addSubFolder
method to create children. |
protected void |
issueChildAddedEvent(Node child)
Notifies all listenters that a child has been added to this Folder. |
Methods inherited from class org.sape.carbon.core.config.node.AbstractNode |
addNodeListener, addNodeListener, addNodeListener, backingDataExists, containsChild, destroyBackingData, fetchChild, fetchChildren, getAbsoluteName, getAddOrLoadChildLock, getAllChildNames, getAllowsChildren, getName, getParent, getReadOrAlterNodeLock, isRemoved, issueChildLoadedEvent, issueNodeRemovedEvent, loadChild, 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 final NodeFactory subFolderFactory
private final NodeFactory configurationDocumentFactory
private final NodeFactory linkNodeFactory
Constructor Detail |
public AbstractFolder(Node parent, String name, Object readOrAlterNodeLock, Object addOrLoadChildLock, NodeFactory subFolderFactory, NodeFactory configurationDocumentFactory, NodeFactory linkNodeFactory)
parent
- the node's parentname
- the node's namesubFolderFactory
- factory to use for sub foldersconfigurationDocumentFactory
- factory to use for
creating configuration documentslinkNodeFactory
- factory to use for creating link nodes.
InvalidParameterException
- if name, subFolderFactory, or
configurationDocumentFactory is nullpublic AbstractFolder(Node parent, String name, NodeFactory subFolderFactory, NodeFactory configurationDocumentFactory, NodeFactory linkNodeFactory)
parent
- the node's parentname
- the node's namesubFolderFactory
- factory to use for sub foldersconfigurationDocumentFactory
- factory to use for
creating configuration documentslinkNodeFactory
- factory to use for creating link nodes.
InvalidParameterException
- if name, subFolderFactory, or
configurationDocumentFactory is nullMethod Detail |
public ConfigurationDocument addConfigurationDocument(String name, Configuration config) throws NodeCreationException
Folder
ConfigurationDocument
and returns a
reference to the newly created ConfigurationDocument
.
addConfigurationDocument
in interface Folder
name
- Name of the ConfigurationDocument to be created.config
- the document to add to the Folder
NodeCreationException
- when the node can not
be created, possibly because the node element already exists in
this node, or creation of the node is otherwise forbidden. An exception
should also be thrown when this node's getAllowsChildren method returns
false
.synchronized to ensure no one is fetching or removing children while
this method is removing them
public Folder addSubFolder(String name) throws NodeCreationException
Folder
Folder
and returns a reference to
the newly created Folder
.
addSubFolder
in interface Folder
name
- Name of the Folder to be created.
NodeCreationException
- when the node can not
be created, possibly because the node element already exists in
this node, or creation of the node is otherwise forbidden. An exception
should also be thrown when this node's getAllowsChildren method returns
false
.synchronized to ensure no one is fetching or removing children while
this method is removing them
public LinkNode addLink(String name, LinkNodeConfiguration linkConfiguration) throws NodeCreationException
Folder
addLink
in interface Folder
name
- name of the link to addlinkConfiguration
- the link configuration to create
NodeCreationException
- indicates an error adding the linkFolder.addLink(java.lang.String, org.sape.carbon.core.config.node.link.LinkNodeConfiguration)
public NodeFactory getConfigurationDocumentFactory()
Folder
addConfigurationDocument
method to create children. This can be used by sub
Folder
s to create their own children.
getConfigurationDocumentFactory
in interface Folder
ConfigurationDocument
sFolder.getConfigurationDocumentFactory()
public NodeFactory getSubFolderFactory()
Folder
addSubFolder
method to create children. This can be used by sub
Folder
s to create their own children.
getSubFolderFactory
in interface Folder
Folder
sFolder.getSubFolderFactory()
protected Folder createNewFolder(String name) throws NodeCreationException
Folder
and
adds it to childNodes
name
- name of the Folder
NodeCreationException
- if the child could not be created for
any reasonprotected ConfigurationDocument createNewConfigurationDocument(String name, Configuration config) throws NodeCreationException
ConfigurationDocument
and adds it to childNodes.
name
- name of the ConfigurationDocument
config
- the new config to write
NodeCreationException
- if the child could not be created for
any reasonpublic NodeFactory getLinkNodeFactory()
Folder
addLinkNode
method to create children. This can be used by sub
Folder
s to create their own children.
getLinkNodeFactory
in interface Folder
ConfigurationDocument
sFolder.getSubFolderFactory()
protected void issueChildAddedEvent(Node child)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |