xmltooling::ReloadableXMLFile Class Reference

Base class for file-based XML configuration. More...

#include <xmltooling/util/ReloadableXMLFile.h>

Inheritance diagram for xmltooling::ReloadableXMLFile:

xmltooling::Lockable List of all members.

Public Member Functions

Lockable * lock ()
 Lock the associated object for exclusive access.
void unlock ()
 Unlock the associated object from exclusive access.

Protected Member Functions

 ReloadableXMLFile (const xercesc::DOMElement *e, logging::Category &log)
 Constructor taking a DOM element supporting the following content:.
virtual std::pair< bool, xercesc::DOMElement * > load ()
 Loads configuration material.

Protected Attributes

const xercesc::DOMElement * m_root
 Root of the original DOM element passed into constructor.
bool m_local
 Indicates whether resources is local or remote.
bool m_validate
 Use a validating parser when parsing XML.
std::string m_source
 Resource location, may be a local path or a URI.
std::string m_backing
 Path to backup copy for remote resources.
time_t m_filestamp
 Last modification of local resource or reload of remote resource.
time_t m_reloadInterval
 Time in seconds to wait before trying for new copy of remote resource.
RWLock * m_lock
 Shared lock for guarding reloads.
logging::Category & m_log
 Logging object.

Detailed Description

Base class for file-based XML configuration.


Constructor & Destructor Documentation

xmltooling::ReloadableXMLFile::ReloadableXMLFile ( const xercesc::DOMElement *  e,
logging::Category &  log 
) [protected]

Constructor taking a DOM element supporting the following content:.

file | filename | path | pathname
identifies a local file
uri | url
identifies a remote resource
validate
use a validating parser
reloadChanges
enables monitoring of local file for changes
reloadInterval
enables periodic refresh of remote file
backingFilePath
location for backup of remote resource

Parameters:
e DOM to supply configuration
log logging object to use


Member Function Documentation

virtual std::pair<bool,xercesc::DOMElement*> xmltooling::ReloadableXMLFile::load (  )  [protected, virtual]

Loads configuration material.

This method is called to load configuration material initially and any time a change is detected. The base version performs basic parsing duties and returns the result.

Returns:
a pair consisting of a flag indicating whether to take ownership of the document, and the root element of the tree to load

Lockable* xmltooling::ReloadableXMLFile::lock (  )  [virtual]

Lock the associated object for exclusive access.

Returns:
a pointer to the object being locked

Implements xmltooling::Lockable.


The documentation for this class was generated from the following file:
Generated on Thu Dec 3 12:44:29 2009 for xmltooling by  doxygen 1.4.7