Base class for file-based XML configuration. More...
#include <xmltooling/util/ReloadableXMLFile.h>
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. |
Base class for file-based XML configuration.
xmltooling::ReloadableXMLFile::ReloadableXMLFile | ( | const xercesc::DOMElement * | e, | |
logging::Category & | log | |||
) | [protected] |
Constructor taking a DOM element supporting the following content:
e | DOM to supply configuration | |
log | logging object to use |
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.
Lockable* xmltooling::ReloadableXMLFile::lock | ( | ) | [virtual] |
Lock the associated object for exclusive access.
Implements xmltooling::Lockable.
std::string xmltooling::ReloadableXMLFile::m_backing [protected] |
Path to backup copy for remote resources.
time_t xmltooling::ReloadableXMLFile::m_filestamp [protected] |
Last modification of local resource or reload of remote resource.
bool xmltooling::ReloadableXMLFile::m_local [protected] |
Indicates whether resources is local or remote.
RWLock* xmltooling::ReloadableXMLFile::m_lock [protected] |
Shared lock for guarding reloads.
logging::Category& xmltooling::ReloadableXMLFile::m_log [protected] |
Logging object.
time_t xmltooling::ReloadableXMLFile::m_reloadInterval [protected] |
Time in seconds to wait before trying for new copy of remote resource.
const xercesc::DOMElement* xmltooling::ReloadableXMLFile::m_root [protected] |
Root of the original DOM element passed into constructor.
std::string xmltooling::ReloadableXMLFile::m_source [protected] |
Resource location, may be a local path or a URI.
bool xmltooling::ReloadableXMLFile::m_validate [protected] |
Use a validating parser when parsing XML.