xmltooling 3.2.4
|
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, bool startReloadThread=true, bool deprecationSupport=true) | |
Constructor taking a DOM element supporting the following content: | |
virtual std::pair< bool, xercesc::DOMElement * > | background_load () |
Loads configuration material. | |
virtual std::pair< bool, xercesc::DOMElement * > | load (bool backup, std::string backingFile) |
Basic load/parse of configuration material. | |
virtual Lockable * | getBackupLock () |
Accesses a lock interface protecting use of backup file associated with the object. | |
std::pair< bool, xercesc::DOMElement * > | load () |
Basic load/parse of configuration material. | |
void | preserveCacheTag () |
Preserves the last remote resource caching identifier in a backup file for use on the next restart. | |
void | startup () |
Starts up reload thread, can be automatically called by constructor, or manually invoked by subclass. | |
void | shutdown () |
Shuts down reload thread, should be called from subclass destructor. | |
![]() |
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 resource. | |
time_t | m_filestamp |
Last modification of local resource. | |
long | m_reloadInterval |
Time in seconds to wait before trying for new copy of remote resource. | |
std::string | m_cacheTag |
Caching tag associated with remote resource. | |
boost::scoped_ptr< RWLock > | m_lock |
Shared lock for guarding reloads. | |
logging::Category & | m_log |
Logging object. | |
std::string | m_id |
Plugin identifier. | |
bool | m_loaded |
Indicates whether a usable version of the resource is in place. | |
boost::scoped_ptr< CredentialResolver > | m_credResolver |
CredentialResolver for signature verification. | |
boost::scoped_ptr< SignatureTrustEngine > | m_trust |
TrustEngine for signature verification. | |
std::string | m_signerName |
Name of signer for signature verification. | |
Base class for file-based XML configuration.
|
protected |
Constructor taking a DOM element supporting the following content:
e | DOM to supply configuration |
log | logging object to use |
startReloadThread | true iff refresh thread for resources should be started by constructor |
deprecationSupport | true iff deprecated options and settings should be accepted |
|
protectedvirtual |
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.
This method is not called with the object locked, so actual modification of implementation state requires explicit locking within the method override.
|
protectedvirtual |
Accesses a lock interface protecting use of backup file associated with the object.
The lock is NOT acquired automatically.
|
protected |
Basic load/parse of configuration material.
The base version erforms basic parsing duties and returns the result. Subclasses should override the new background_load() method and perform their own locking in conjunction with calling this method.
|
protectedvirtual |
Basic load/parse of configuration material.
The base version performs basic parsing duties and returns the result. Subclasses should override the new background_load() method and perform their own locking in conjunction with use of this method.
This version allows subclasses to explicitly control the use of a backup for remote resources, which allows additional validation to be performed besides just successful XML parsing.
Anyone calling this code needs to take ownership of the job of creating the backup (if the input is well formed). As an assist, providing a unique file name as the second parameter causes the input source to be copied to this file. Thus backup can be done without locking and the job of creating the backup consists of doing a rename (under the lock).
backup | true iff the backup source should be loaded |
backingFile | Filename to copy the input to |
|
virtual |
Lock the associated object for exclusive access.
Implements xmltooling::Lockable.
|
virtual |
Unlock the associated object from exclusive access.
Implements xmltooling::Lockable.