diff options
-rw-r--r-- | lib/CommLayer/CommLayerServerDBus.cpp | 12 | ||||
-rw-r--r-- | lib/CommLayer/CommLayerServerDBus.h | 2 | ||||
-rw-r--r-- | lib/CommLayer/DBusServerProxy.cpp | 24 | ||||
-rw-r--r-- | lib/CommLayer/DBusServerProxy.h | 4 | ||||
-rw-r--r-- | lib/CommLayer/Observer.h | 2 | ||||
-rw-r--r-- | src/Daemon/CrashWatcher.cpp | 32 | ||||
-rw-r--r-- | src/Daemon/CrashWatcher.h | 3 |
7 files changed, 79 insertions, 0 deletions
diff --git a/lib/CommLayer/CommLayerServerDBus.cpp b/lib/CommLayer/CommLayerServerDBus.cpp index 864a042d..d2b6d4d1 100644 --- a/lib/CommLayer/CommLayerServerDBus.cpp +++ b/lib/CommLayer/CommLayerServerDBus.cpp @@ -120,3 +120,15 @@ map_plugin_settings_t CCommLayerServerDBus::GetPluginSettings(const std::string& { return m_pObserver->GetPluginSettings(pName); } + + +void CCommLayerServerDBus::RegisterPlugin(const std::string& pName) +{ + return m_pObserver->RegisterPlugin(pName); +} + +void CCommLayerServerDBus::UnRegisterPlugin(const std::string& pName) +{ + return m_pObserver->UnRegisterPlugin(pName); +} + diff --git a/lib/CommLayer/CommLayerServerDBus.h b/lib/CommLayer/CommLayerServerDBus.h index cae27421..bec75672 100644 --- a/lib/CommLayer/CommLayerServerDBus.h +++ b/lib/CommLayer/CommLayerServerDBus.h @@ -28,6 +28,8 @@ class CCommLayerServerDBus virtual map_crash_report_t GetJobResult(uint64_t pJobID, const std::string& pSender); virtual vector_map_string_string_t GetPluginsInfo(); virtual map_plugin_settings_t GetPluginSettings(const std::string& pName); + void RegisterPlugin(const std::string& pName); + void UnRegisterPlugin(const std::string& pName); virtual void Crash(const std::string& arg1); virtual void AnalyzeComplete(map_crash_report_t arg1); diff --git a/lib/CommLayer/DBusServerProxy.cpp b/lib/CommLayer/DBusServerProxy.cpp index 18a7c0ca..0693c6dd 100644 --- a/lib/CommLayer/DBusServerProxy.cpp +++ b/lib/CommLayer/DBusServerProxy.cpp @@ -32,6 +32,8 @@ CDBusServer_adaptor::CDBusServer_adaptor() register_method(CDBusServer_adaptor, GetJobResult, _GetJobResult_stub); register_method(CDBusServer_adaptor, GetPluginsInfo, _GetPluginsInfo_stub); register_method(CDBusServer_adaptor, GetPluginSettings, _GetPluginSettings_stub); + register_method(CDBusServer_adaptor, RegisterPlugin, _RegisterPlugin_stub); + register_method(CDBusServer_adaptor, UnRegisterPlugin, _UnRegisterPlugin_stub); } /* reveal Interface introspection when we stabilize the API */ /* @@ -218,3 +220,25 @@ DBus::Message CDBusServer_adaptor::_GetPluginSettings_stub(const DBus::CallMessa wi << plugin_settings; return reply; } + +DBus::Message CDBusServer_adaptor::_RegisterPlugin_stub(const DBus::CallMessage &call) +{ + DBus::MessageIter ri = call.reader(); + std::string PluginName; + ri >> PluginName; + RegisterPlugin(PluginName); + DBus::ReturnMessage reply(call); + //DBus::MessageIter wi = reply.writer(); + //wi << plugin_settings; + return reply; +} + +DBus::Message CDBusServer_adaptor::_UnRegisterPlugin_stub(const DBus::CallMessage &call) +{ + DBus::MessageIter ri = call.reader(); + std::string PluginName; + ri >> PluginName; + UnRegisterPlugin(PluginName); + DBus::ReturnMessage reply(call); + return reply; +} diff --git a/lib/CommLayer/DBusServerProxy.h b/lib/CommLayer/DBusServerProxy.h index d7ad88a0..495309b7 100644 --- a/lib/CommLayer/DBusServerProxy.h +++ b/lib/CommLayer/DBusServerProxy.h @@ -51,6 +51,8 @@ public: virtual map_crash_report_t GetJobResult(uint64_t pJobID, const std::string& pDBusSender) = 0; virtual vector_map_string_string_t GetPluginsInfo() = 0; virtual map_plugin_settings_t GetPluginSettings(const std::string& pName) = 0; + virtual void RegisterPlugin(const std::string& pName) = 0; + virtual void UnRegisterPlugin(const std::string& pName) = 0; public: /* signal emitters for this interface @@ -74,6 +76,8 @@ private: DBus::Message _GetJobResult_stub(const DBus::CallMessage &call); DBus::Message _GetPluginsInfo_stub(const DBus::CallMessage &call); DBus::Message _GetPluginSettings_stub(const DBus::CallMessage &call); + DBus::Message _RegisterPlugin_stub(const DBus::CallMessage &call); + DBus::Message _UnRegisterPlugin_stub(const DBus::CallMessage &call); }; #endif diff --git a/lib/CommLayer/Observer.h b/lib/CommLayer/Observer.h index 8b3a85f7..ec7268e8 100644 --- a/lib/CommLayer/Observer.h +++ b/lib/CommLayer/Observer.h @@ -27,6 +27,8 @@ class CObserver { virtual map_crash_report_t GetJobResult(uint64_t pJobID, const std::string &pSender) = 0; virtual vector_map_string_string_t GetPluginsInfo() = 0; virtual map_plugin_settings_t GetPluginSettings(const std::string& pName) = 0; + virtual void RegisterPlugin(const std::string& pName) = 0; + virtual void UnRegisterPlugin(const std::string& pName) = 0; }; #endif /* OBSERVER_H_ */ diff --git a/src/Daemon/CrashWatcher.cpp b/src/Daemon/CrashWatcher.cpp index 344dda7a..0b98454e 100644 --- a/src/Daemon/CrashWatcher.cpp +++ b/src/Daemon/CrashWatcher.cpp @@ -908,3 +908,35 @@ map_plugin_settings_t CCrashWatcher::GetPluginSettings(const std::string& pName) Warning(e.what()); } } + +void CCrashWatcher::RegisterPlugin(const std::string& pName) +{ + try + { + m_pMW->RegisterPlugin(pName); + } + catch(CABRTException &e) + { + if (e.type() == EXCEP_FATAL) + { + throw e; + } + Warning(e.what()); + } +} + +void CCrashWatcher::UnRegisterPlugin(const std::string& pName) +{ + try + { + m_pMW->UnRegisterPlugin(pName); + } + catch(CABRTException &e) + { + if (e.type() == EXCEP_FATAL) + { + throw e; + } + Warning(e.what()); + } +} diff --git a/src/Daemon/CrashWatcher.h b/src/Daemon/CrashWatcher.h index 68a21a5a..689d2108 100644 --- a/src/Daemon/CrashWatcher.h +++ b/src/Daemon/CrashWatcher.h @@ -130,8 +130,11 @@ class CCrashWatcher virtual bool Report(map_crash_report_t pReport, const std::string &pUID); virtual bool DeleteDebugDump(const std::string& pUUID, const std::string& pUID); virtual map_crash_report_t GetJobResult(uint64_t pJobID, const std::string& pSender); + /* plugins related */ virtual vector_map_string_string_t GetPluginsInfo(); virtual map_plugin_settings_t GetPluginSettings(const std::string& pName); + void RegisterPlugin(const std::string& pName); + void UnRegisterPlugin(const std::string& pName); /* Observer methods */ void Status(const std::string& pMessage,const std::string& pDest="0"); |