using namespace log4cpp;
using namespace std;
+// Expose entry points when used as an extension library
+
+extern "C" int SAML_API xmltooling_extension_init(void*)
+{
+ if (SAMLConfig::getConfig().init(false))
+ return 0;
+ return -1;
+}
+
+extern "C" void SAML_API xmltooling_extension_term()
+{
+ SAMLConfig::getConfig().term(false);
+}
+
DECL_EXCEPTION_FACTORY(ArtifactException,opensaml);
DECL_EXCEPTION_FACTORY(MetadataFilterException,opensaml::saml2md);
return g_config;
}
-bool SAMLInternalConfig::init()
+bool SAMLInternalConfig::init(bool initXMLTooling)
{
#ifdef _DEBUG
xmltooling::NDC ndc("init");
Category& log=Category::getInstance(SAML_LOGCAT".SAMLConfig");
log.debug("library initialization started");
- XMLToolingConfig::getConfig().init();
- log.debug("XMLTooling library initialized");
+ if (initXMLTooling) {
+ XMLToolingConfig::getConfig().init();
+ log.debug("XMLTooling library initialized");
+ }
REGISTER_EXCEPTION_FACTORY(ArtifactException,opensaml);
REGISTER_EXCEPTION_FACTORY(MetadataFilterException,opensaml::saml2md);
return true;
}
-void SAMLInternalConfig::term()
+void SAMLInternalConfig::term(bool termXMLTooling)
{
#ifdef _DEBUG
xmltooling::NDC ndc("term");
#endif
+ Category& log=Category::getInstance(SAML_LOGCAT".SAMLConfig");
saml1::AssertionSchemaValidators.destroyValidators();
saml1p::ProtocolSchemaValidators.destroyValidators();
MetadataProviderManager.deregisterFactories();
TrustEngineManager.deregisterFactories();
- XMLToolingConfig::getConfig().term();
- Category::getInstance(SAML_LOGCAT".SAMLConfig").info("library shutdown complete");
+ if (termXMLTooling) {
+ XMLToolingConfig::getConfig().term();
+ log.debug("XMLTooling library shut down");
+ }
+ log.info("library shutdown complete");
}
void SAMLInternalConfig::generateRandomBytes(void* buf, unsigned int len)
* Initializes library\r
* \r
* Each process using the library MUST call this function exactly once\r
- * before using any library classes.\r
+ * before using any library classes. The flag controls whether this is the\r
+ * "dominant" library or not and can allow the SAML library to be loaded\r
+ * as an extension of XMLTooling rather than subsuming it.\r
* \r
+ * @param initXMLTooling true iff this method should initialize the XMLTooling layer\r
* @return true iff initialization was successful \r
*/\r
- virtual bool init()=0;\r
+ virtual bool init(bool initXMLTooling=true)=0;\r
\r
/**\r
* Shuts down library\r
* \r
* Each process using the library SHOULD call this function exactly once\r
- * before terminating itself\r
+ * before terminating itself. The flag controls whether this is the\r
+ * "dominant" library or not and can allow the SAML library to be loaded\r
+ * as an extension of XMLTooling rather than subsuming it.\r
+ * \r
+ * @param termXMLTooling true iff this method should shutdown the XMLTooling layer\r
*/\r
- virtual void term()=0;\r
+ virtual void term(bool termXMLTooling=true)=0;\r
\r
/**\r
* Generate random information using the underlying security library\r
static SAMLInternalConfig& getInternalConfig();
// global per-process setup and shutdown of runtime
- bool init();
- void term();
+ bool init(bool initXMLTooling=true);
+ void term(bool termXMLTooling=true);
void generateRandomBytes(void* buf, unsigned int len);
void generateRandomBytes(std::string& buf, unsigned int len);
>\r
</Filter>\r
</Filter>\r
+ <Filter\r
+ Name="binding"\r
+ >\r
+ <Filter\r
+ Name="impl"\r
+ >\r
+ </Filter>\r
+ </Filter>\r
</Filter>\r
<Filter\r
Name="signature"\r
</File>\r
</Filter>\r
</Filter>\r
+ <Filter\r
+ Name="binding"\r
+ >\r
+ <Filter\r
+ Name="impl"\r
+ >\r
+ </Filter>\r
+ </Filter>\r
</Filter>\r
<Filter\r
Name="encryption"\r
Name="profile"\r
>\r
</Filter>\r
+ <Filter\r
+ Name="binding"\r
+ >\r
+ </Filter>\r
</Filter>\r
<Filter\r
Name="signature"\r
>\r
</File>\r
</Filter>\r
+ <Filter\r
+ Name="binding"\r
+ >\r
+ </Filter>\r
</Filter>\r
<Filter\r
Name="encryption"\r
*/\r
\r
#include "internal.h"\r
+#include <saml/SAMLConfig.h>\r
#include <saml/saml1/core/SAMLArtifactType0001.h>\r
#include <saml/saml1/core/SAMLArtifactType0002.h>\r
#include <saml/saml2/core/SAML2ArtifactType0004.h>\r
*/\r
\r
#include "internal.h"\r
+#include <saml/SAMLConfig.h>\r
#include <saml/saml1/core/SAMLArtifactType0001.h>\r
\r
using namespace opensaml::saml1p;\r
*/\r
\r
#include "internal.h"\r
+#include <saml/SAMLConfig.h>\r
#include <saml/saml1/core/SAMLArtifactType0002.h>\r
\r
using namespace opensaml::saml1p;\r
*/\r
\r
#include "internal.h"\r
+#include <saml/SAMLConfig.h>\r
#include <saml/saml2/core/SAML2ArtifactType0004.h>\r
\r
using namespace opensaml::saml2p;\r
#include <fstream>
#include <saml/exceptions.h>
-#include <saml/SAMLConfig.h>
#include <saml/util/SAMLConstants.h>
#include <xmltooling/exceptions.h>
#include <xmltooling/validation/Validator.h>
#include <xmltooling/XMLObject.h>
#include <xmltooling/XMLObjectBuilder.h>
+#include <xmltooling/XMLToolingConfig.h>
using namespace opensaml;
using namespace xmltooling;
*/\r
\r
#include "internal.h"\r
+#include <saml/SAMLConfig.h>\r
#include <saml/saml2/core/SAML2ArtifactType0004.h>\r
#include <saml/saml2/metadata/Metadata.h>\r
#include <saml/saml2/metadata/MetadataProvider.h>\r
*/\r
\r
#include "internal.h"\r
+#include <saml/SAMLConfig.h>
\r
#include <fstream>\r
#include <cxxtest/GlobalFixture.h>\r
*/\r
\r
#include "internal.h"\r
+#include <saml/SAMLConfig.h>\r
#include <saml/security/AbstractPKIXTrustEngine.h>\r
#include <saml/saml2/metadata/MetadataProvider.h>\r
\r
*/\r
\r
#include "internal.h"\r
+#include <saml/SAMLConfig.h>\r
#include <saml/security/TrustEngine.h>\r
#include <saml/saml2/metadata/MetadataProvider.h>\r
\r