summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schanda <schanda@itestra.de>2013-10-09 11:57:11 +0200
committerJohannes Schanda <schanda@itestra.de>2013-10-09 11:57:11 +0200
commit7de7257bc429924e41289878550cf99ac2bf8dc7 (patch)
treefc74afefe3620ee630c136aab8062c6e7ba15d9c
parent013296d873a4256e2967faa5487b7135bb4afee7 (diff)
downloadgenivi-common-api-dbus-runtime-7de7257bc429924e41289878550cf99ac2bf8dc7.tar.gz
Deprecated facotry-based registration for stubs fixed
-rw-r--r--src/CommonAPI/DBus/DBusFactory.cpp16
-rw-r--r--src/CommonAPI/DBus/DBusFactory.h8
-rw-r--r--src/CommonAPI/DBus/DBusServicePublisher.h2
3 files changed, 26 insertions, 0 deletions
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> stubBase,
+ const char* interfaceId,
+ const std::string& participantId,
+ const std::string& serviceName,
+ const std::string& domain) {
+
+ std::shared_ptr<DBusServicePublisher> pub = std::dynamic_pointer_cast<DBusServicePublisher>(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<DBusFacto
virtual std::shared_ptr<Proxy> 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> 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<DBusServiceRegistry> 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