|
|||||||||||
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.file.FileConfigurationDocument
A node that represents a physical configuration file within a file system.
Files are read and writen using a ConfigurationFormatService
.
These nodes
may not have children. Read and write access to the underlying file
is synchronized for thread safety.
Copyright 2002 Sapient
FileFolder
,
ConfigurationFormatService
Field Summary | |
private File |
file
file where this node's configuration is persisted |
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 | |
FileConfigurationDocument(Node parent,
String name,
ConfigurationFormatService formatter,
File file)
Constructor for FileConfigurationDocument. |
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. |
(package private) File |
getInternalFileObject()
Accessor method for file. |
protected InputStream |
openInputStream()
This method should be overridden by classes implementing ConfigurationDocument s for specific data stores. |
protected OutputStream |
openOutputStream()
This method should be overridden by classes implementing ConfigurationDocument s for specific data stores. |
Methods inherited from class org.sape.carbon.core.config.node.AbstractConfigurationDocument |
addNestedConfigurationDocument, closeInputStream, closeOutputStream, getAllChildNames, getFormatService, getNestedNodeFactory, issueNodeModifiedEvent, loadChild, notifyNestedDocuments, readConfiguration, refresh, remove, writeChildReferences, writeConfiguration |
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, 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 |
Field Detail |
private File file
Constructor Detail |
public FileConfigurationDocument(Node parent, String name, ConfigurationFormatService formatter, File file)
parent
- the parent node containing this configuration.name
- name of the configuration being loadedformatter
- formatter for the documentfile
- file containing the configuration document
NullPointerException
- if file is nullMethod Detail |
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 InputStream openInputStream() throws IOException
AbstractConfigurationDocument
ConfigurationDocument
s for specific data stores.
The returned InputStream
should be a stream of data
that can be read by the ConfigurationFormatService
and
converted to a Configuration
object.
This method is called by readConfiguration.
openInputStream
in class AbstractConfigurationDocument
InputStream
from which to read
the Configuration
object within this
ConfigurationDocument
IOException
AbstractConfigurationDocument.openInputStream()
protected OutputStream openOutputStream() throws IOException
AbstractConfigurationDocument
ConfigurationDocument
s for specific data stores.
The returned OutputStream
should be a stream of data
that can be written to by the ConfigurationFormatService
.
This method is called by writeConfiguration.
openOutputStream
in class AbstractConfigurationDocument
OutputStream
to which to write
the Configuration
object within this
ConfigurationDocument
IOException
AbstractConfigurationDocument.openOutputStream()
protected boolean backingDataExists()
AbstractNode
backingDataExists
in class AbstractNode
AbstractNode.backingDataExists()
File getInternalFileObject()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |