|
|||||||||||
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.jndi.JNDIFolder
A node that represents a JNDI context that contains other folders or documents. This implementation implements NamespaceChangeListener and ObjectChangeListener from the javax.naming.event package in order to listen for changes in the backing datastore. Copyright 2003 Sapient
Field Summary | |
private JNDILinkNodeConfiguration |
config
|
private DirContext |
initialContext
|
private org.apache.commons.logging.Log |
log
|
private Name |
nodeContextName
|
private static String |
SUBCONTEXT_FILTER
Filter string used in getAllChildNames to get folders and documents names |
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 | |
protected |
JNDIFolder(Node parent,
String name,
NodeFactory subFolderFactory,
NodeFactory configurationDocumentFactory,
NodeFactory linkNodeFactory,
DirContext initialContext,
Name nodeContextName,
JNDILinkNodeConfiguration config)
Constructs the JNDIFolder and registers itself as a JNDI naming listener |
Method Summary | |
protected boolean |
backingDataExists()
Checks the backing directory to see if this nodes context exists and if it does, has the right attributes. |
protected void |
destroyBackingData()
Calls destroySubcontext with this context's name |
protected Set |
getAllChildNames()
Called by fetchChildren to get the names of all the children from the backing data store. |
(package private) DirContext |
getInitialContext()
Gets this nodes initial context. |
(package private) Name |
getNodeContextName()
Gets this nodes context name. |
protected Node |
loadChild(String nodeName)
Loads the child specified by nodeName from the backing data store. |
private Node |
loadChildLinkNode(String nodeName)
Helper method to create a sub link |
private Node |
loadConfigurationDocument(String nodeName)
Helper method to create a configuration document |
private Node |
loadSubFolder(String nodeName)
Helper method to create a sub folder |
void |
namingExceptionThrown(NamingExceptionEvent evt)
Logs the fact that a NamingExceptionEvent occured |
void |
objectAdded(NamingEvent evt)
This implementation does not do anything if an object is added because the child could not have been loaded yet could not be cached |
void |
objectChanged(NamingEvent evt)
Causes a refresh of this node |
void |
objectRemoved(NamingEvent evt)
Causes a refresh of this node |
void |
objectRenamed(NamingEvent evt)
Causes a refresh of this node |
protected void |
registerNamingListener()
Registers this node as a NamingListener with the backing context |
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 static final String SUBCONTEXT_FILTER
private DirContext initialContext
private Name nodeContextName
private JNDILinkNodeConfiguration config
Constructor Detail |
protected JNDIFolder(Node parent, String name, NodeFactory subFolderFactory, NodeFactory configurationDocumentFactory, NodeFactory linkNodeFactory, DirContext initialContext, Name nodeContextName, JNDILinkNodeConfiguration config)
parent
- the parent node of this nodename
- the name of this nodesubFolderFactory
- factory used to create sub foldersconfigurationDocumentFactory
- factory used to create sub documentslinkNodeFactory
- factory used to create sub linksinitialContext
- the jndi initial contextnodeContextName
- the name of this node's contextconfig
- configuration used to get the names of the attributes
that hold node name, node and document type, and document content as well
as valid attribute values for node and document type.Method Detail |
protected Set getAllChildNames()
AbstractNode
getAllChildNames
in class AbstractNode
String
s, the names of all the childrenprotected Node loadChild(String nodeName) throws NodeNotFoundException
AbstractNode
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.protected void destroyBackingData() throws NodeRemovalException
destroyBackingData
in class AbstractNode
NodeRemovalException
- if a NamingException is encounteredDirContext getInitialContext()
Name getNodeContextName()
private Node loadSubFolder(String nodeName) throws NodeCreationException
nodeName
-
NodeCreationException
private Node loadConfigurationDocument(String nodeName) throws NodeCreationException
nodeName
-
NodeCreationException
private Node loadChildLinkNode(String nodeName) throws NodeCreationException
nodeName
-
NodeCreationException
protected boolean backingDataExists()
backingDataExists
in class AbstractNode
public void objectAdded(NamingEvent evt)
objectAdded
in interface NamespaceChangeListener
public void objectRemoved(NamingEvent evt)
objectRemoved
in interface NamespaceChangeListener
public void objectRenamed(NamingEvent evt)
objectRenamed
in interface NamespaceChangeListener
public void objectChanged(NamingEvent evt)
objectChanged
in interface ObjectChangeListener
public void namingExceptionThrown(NamingExceptionEvent evt)
namingExceptionThrown
in interface NamingListener
protected void registerNamingListener()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |