/*\r
- * Copyright 2001-2005 Internet2\r
+ * Copyright 2001-2007 Internet2\r
* \r
* Licensed under the Apache License, Version 2.0 (the "License");\r
* you may not use this file except in compliance with the License.\r
}\r
\r
flag=e->getAttributeNS(NULL,reloadChanges);\r
- if (!flag || XMLString::equals(flag,xmlconstants::XML_TRUE) || XMLString::equals(flag,xmlconstants::XML_ONE)) {\r
+ if (!XMLString::equals(flag,xmlconstants::XML_FALSE) && !XMLString::equals(flag,xmlconstants::XML_ZERO)) {\r
if (m_local) {\r
#ifdef WIN32\r
struct _stat stat_buf;\r
}\r
catch (XMLException& e) {\r
auto_ptr_char msg(e.getMessage());\r
- log.errorStream() << "Xerces error while loading resource (" << m_source << "): "\r
+ log.critStream() << "Xerces error while loading resource (" << m_source << "): "\r
<< msg.get() << CategoryStream::ENDLINE;\r
throw XMLParserException(msg.get());\r
}\r
- catch (XMLToolingException& e) {\r
- log.errorStream() << "error while loading configuration from ("\r
+ catch (exception& e) {\r
+ log.critStream() << "error while loading configuration from ("\r
<< (m_source.empty() ? "inline" : m_source) << "): " << e.what() << CategoryStream::ENDLINE;\r
throw;\r
}\r
\r
// Update the timestamp regardless. No point in repeatedly trying.\r
m_filestamp=stat_buf.st_mtime;\r
+ Category::getInstance(XMLTOOLING_LOGCAT".ReloadableXMLFile").info("change detected, reloading local resource...");\r
}\r
else {\r
if (isValid())\r
m_lock->rdlock();\r
return this;\r
}\r
+ Category::getInstance(XMLTOOLING_LOGCAT".ReloadableXMLFile").info("local copy invalid, reloading remote resource...");\r
}\r
\r
// Do this once...\r
- do {\r
+ try {\r
// At this point we're holding the write lock, so make sure we pop it.\r
SharedLock lockwrap(m_lock,false);\r
pair<bool,DOMElement*> ret=load();\r
if (ret.first)\r
ret.second->getOwnerDocument()->release();\r
- } while(0);\r
+ } catch (exception& ex) {\r
+ Category::getInstance(XMLTOOLING_LOGCAT".ReloadableXMLFile").crit(\r
+ "maintaining existing configuration, error reloading resource (%s): %s", m_source.c_str(), ex.what()\r
+ );\r
+ }\r
\r
// If we made it here, the swap may or may not have worked, but we need to relock.\r
m_lock->rdlock();\r