[cpp-sp] 03/03: Add component type to PluginManager for logging.

Scott Cantor cantor.2 at osu.edu
Tue Jan 28 20:57:11 UTC 2025


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch main
in repository cpp-sp.

View the commit online:
http://git.shibboleth.net/view/?p=cpp-sp.git;a=commit;h=0cea21786d5c139a6fc1ef42369c03caf248322b

commit 0cea21786d5c139a6fc1ef42369c03caf248322b
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Tue Jan 28 15:57:04 2025 -0500

    Add component type to PluginManager for logging.
---
 shibsp/impl/AgentConfig.cpp | 17 +++++++++--------
 shibsp/util/PluginManager.h |  5 +++--
 2 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/shibsp/impl/AgentConfig.cpp b/shibsp/impl/AgentConfig.cpp
index ce3174ba..3ae0dcb6 100644
--- a/shibsp/impl/AgentConfig.cpp
+++ b/shibsp/impl/AgentConfig.cpp
@@ -108,7 +108,15 @@ AgentConfig& AgentConfig::getConfig()
     return g_agentConfig;
 }
 
-AgentConfig::AgentConfig()
+AgentConfig::AgentConfig() :
+    AccessControlManager("AccessControl"),
+    AgentManager("Agent"),
+    HandlerManager("Handler"),
+    LoggingServiceManager("LoggingService"),
+    RemotingServiceManager("RemotingService"),
+    RequestMapperManager("RequestMapper"),
+    SecretSourceManager("SecretSource"),
+    SessionCacheManager("SessionCache")
 {
 }
 
@@ -228,13 +236,6 @@ bool AgentInternalConfig::_init(const char* inst_prefix, const char* config_file
 
         registerAccessControls();
         registerRequestMappers();
-
-        /*
-        XMLToolingConfig::getConfig().user_agent = string(PACKAGE_NAME) + '/' + PACKAGE_VERSION;
-
-        registerAttributeFactories();
-        */
-
         registerHandlers();
         registerSecretSources();
         registerRemotingServices();
diff --git a/shibsp/util/PluginManager.h b/shibsp/util/PluginManager.h
index 10181a80..f7fd7b12 100644
--- a/shibsp/util/PluginManager.h
+++ b/shibsp/util/PluginManager.h
@@ -46,7 +46,7 @@ namespace shibsp {
     template <class T, class Key, typename Params> class PluginManager
     {
     public:
-        PluginManager() {}
+        PluginManager(const char* componentType) : m_componentType(componentType) {}
         ~PluginManager() {}
 
         /** Factory function for plugin. */
@@ -92,11 +92,12 @@ namespace shibsp {
         T* newPlugin(const Key& type, const Params& p, bool deprecationSupport) const {
             typename std::map<Key, typename PluginManager::Factory*>::const_iterator i=m_map.find(type);
             if (i==m_map.end())
-                throw std::invalid_argument("Unknown plugin type.");
+                throw std::invalid_argument("Unknown " + m_componentType + " plugin type.");
             return i->second(p, deprecationSupport);
         }
         
     private:
+        std::string m_componentType;
         std::map<Key, typename PluginManager::Factory*> m_map;
     };
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list