From 7de7257bc429924e41289878550cf99ac2bf8dc7 Mon Sep 17 00:00:00 2001 From: Johannes Schanda Date: Wed, 9 Oct 2013 11:57:11 +0200 Subject: Deprecated facotry-based registration for stubs fixed --- src/CommonAPI/DBus/DBusFactory.cpp | 16 ++++++++++++++++ src/CommonAPI/DBus/DBusFactory.h | 8 ++++++++ src/CommonAPI/DBus/DBusServicePublisher.h | 2 ++ 3 files changed, 26 insertions(+) diff --git a/src/CommonAPI/DBus/DBusFactory.cpp b/src/CommonAPI/DBus/DBusFactory.cpp index 4571a4a..782b9ce 100644 --- a/src/CommonAPI/DBus/DBusFactory.cpp +++ b/src/CommonAPI/DBus/DBusFactory.cpp @@ -196,6 +196,22 @@ bool DBusFactory::unregisterService(const std::string& participantId, const std: return DBusServicePublisher::getInstance()->unregisterService(serviceAddress); } +COMMONAPI_DEPRECATED bool DBusFactory::registerAdapter(std::shared_ptr stubBase, + const char* interfaceId, + const std::string& participantId, + const std::string& serviceName, + const std::string& domain) { + + std::shared_ptr pub = std::dynamic_pointer_cast(runtime_->getServicePublisher()); + return pub->registerService( + stubBase, + interfaceId, + participantId, + serviceName, + domain, + shared_from_this()); +} + } // namespace DBus } // namespace CommonAPI diff --git a/src/CommonAPI/DBus/DBusFactory.h b/src/CommonAPI/DBus/DBusFactory.h index 1c4ddbf..ec40ff9 100644 --- a/src/CommonAPI/DBus/DBusFactory.h +++ b/src/CommonAPI/DBus/DBusFactory.h @@ -71,6 +71,14 @@ class DBusFactory: public Factory, public std::enable_shared_from_this createProxy(const char* interfaceId, const std::string& participantId, const std::string& serviceName, const std::string& domain); + protected: + + COMMONAPI_DEPRECATED virtual bool registerAdapter(std::shared_ptr stubBase, + const char* interfaceId, + const std::string& participantId, + const std::string& serviceName, + const std::string& domain); + private: SubscriptionStatus isServiceInstanceAliveCallbackThunk(Factory::IsServiceInstanceAliveCallback callback, const AvailabilityStatus& status, std::shared_ptr serviceRegistry); diff --git a/src/CommonAPI/DBus/DBusServicePublisher.h b/src/CommonAPI/DBus/DBusServicePublisher.h index f09a6dc..7df44d7 100644 --- a/src/CommonAPI/DBus/DBusServicePublisher.h +++ b/src/CommonAPI/DBus/DBusServicePublisher.h @@ -51,6 +51,8 @@ class DBusServicePublisher: public ServicePublisher { void unregisterManagedService(DBusServicesMap::iterator& managedServiceIterator); DBusServicesMap registeredServices_; + + friend class DBusFactory; }; } // namespace DBus -- cgit v1.2.1