|
|||||||||||
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.AbstractConfigurationDocument | +--org.sape.carbon.core.config.node.NestedConfigurationDocument
ConfigurationDocument implementation for configurations nested within other ConfigurationDocuments. Parents of this Node can only be AbsractConfigurationDocuments. Copyright 2002 Sapient
Field Summary |
Fields inherited from class org.sape.carbon.core.config.node.AbstractConfigurationDocument |
configuration |
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 |
NestedConfigurationDocument(AbstractConfigurationDocument parent,
String name)
This should only be called by NestedConfigurationDocumentFactory |
Method Summary | |
protected boolean |
backingDataExists()
Method called from the refresh method to see if the backing data still exists. |
protected void |
destroyBackingData()
This method is called by remove to destroy the data
backing this node in the data source. |
private Configuration |
getConfiguration()
Helper method to get the configuration for this node. |
boolean |
isRemoved()
Used to tell whether or not the backing data of a node has been removed. |
void |
onChange()
Called by parent documents when the have changed in order for this node to notify its listeners that a change has occured |
protected InputStream |
openInputStream()
This should never be called. |
protected OutputStream |
openOutputStream()
This should never be called. |
Configuration |
readConfiguration()
This implementation uses the ConfigurationFormatService
to read from the backing data store. |
void |
writeConfiguration(Configuration config)
This implementation uses the ConfigurationFormatService
to write to the backing data store. |
Methods inherited from class org.sape.carbon.core.config.node.AbstractConfigurationDocument |
addNestedConfigurationDocument, closeInputStream, closeOutputStream, getAllChildNames, getFormatService, getNestedNodeFactory, issueNodeModifiedEvent, loadChild, notifyNestedDocuments, refresh, remove, writeChildReferences |
Methods inherited from class org.sape.carbon.core.config.node.AbstractNode |
addNodeListener, addNodeListener, addNodeListener, containsChild, fetchChild, fetchChildren, getAbsoluteName, getAddOrLoadChildLock, getAllowsChildren, getName, getParent, getReadOrAlterNodeLock, issueChildLoadedEvent, issueNodeRemovedEvent, 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 |
Constructor Detail |
protected NestedConfigurationDocument(AbstractConfigurationDocument parent, String name)
parent
- name
- Method Detail |
public Configuration readConfiguration() throws NodeIOException, ConfigurationFormatException
AbstractConfigurationDocument
ConfigurationFormatService
to read from the backing data store. It calls the abstract method
openInputStream
to open an InputStream
to read the Configuration
from then closes it before
it exits.
This method is synchronized to prevent multiple readers from loading
the Configuration
at once and to make sure that
no one is writing a new Configuration
while someone else
is reading.
readConfiguration
in interface ConfigurationDocument
readConfiguration
in class AbstractConfigurationDocument
Configuration
object within this
ConfigurationDocument
NodeIOException
- indicates a generic exception writing the
configuration
ConfigurationFormatException
- indicates an error formating
the config documentConfigurationDocument.readConfiguration()
public void writeConfiguration(Configuration config) throws NodeIOException, ConfigurationFormatException
AbstractConfigurationDocument
ConfigurationFormatService
to write to the backing data store. It calls the abstract method
openOutpuStream
to open an OutputStream
to write the Configuration
to then closes it before
it exits.
This method is synchronized internally to prevent multiple writes from
saving Configuration
s concurrently and to make sure that
no one is writing a new Configuration
while someone else
is reading.
writeConfiguration
in interface ConfigurationDocument
writeConfiguration
in class AbstractConfigurationDocument
config
- the Configuration
to write to the backing
data store
NodeIOException
- indicates a generic exception writing the
configuration
ConfigurationFormatException
- indicates an error formating
the config documentConfigurationDocument.writeConfiguration(Configuration)
public void onChange()
protected InputStream openInputStream() throws IOException
openInputStream
in class AbstractConfigurationDocument
IOException
- never thrown
UnsupportedOperationException
- always thrown to indicate this
method is not supported.protected OutputStream openOutputStream() throws IOException
openOutputStream
in class AbstractConfigurationDocument
IOException
- never thrown
UnsupportedOperationException
- always thrown to indicate this
method is not supported.protected void destroyBackingData() throws NodeRemovalException
AbstractNode
remove
to destroy the data
backing this node in the data source. Implementations of this method
should remove all traces of the Node
's existence
destroyBackingData
in class AbstractNode
NodeRemovalException
- indicates an error removing the nodeAbstractNode.destroyBackingData()
protected boolean backingDataExists()
AbstractNode
backingDataExists
in class AbstractNode
AbstractNode.backingDataExists()
public boolean isRemoved()
Node
isRemoved
in interface Node
isRemoved
in class AbstractNode
Node.isRemoved()
private Configuration getConfiguration() throws NodeIOException, ConfigurationFormatException
NodeIOException
- indicates an error reading the node
ConfigurationFormatException
- indicates an error with the
configuration document
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |