You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@celix.apache.org by pn...@apache.org on 2018/10/01 16:39:40 UTC
celix git commit: CELIX-454: Adds service version to the publisher
service registrations
Repository: celix
Updated Branches:
refs/heads/feature/CELIX-454-pubsub-disc 8a81ff607 -> 3a5ff672b
CELIX-454: Adds service version to the publisher service registrations
Project: http://git-wip-us.apache.org/repos/asf/celix/repo
Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/3a5ff672
Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/3a5ff672
Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/3a5ff672
Branch: refs/heads/feature/CELIX-454-pubsub-disc
Commit: 3a5ff672bc36e53bdaac7bcde7d32fbf771041a7
Parents: 8a81ff6
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Mon Oct 1 18:39:12 2018 +0200
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Mon Oct 1 18:39:12 2018 +0200
----------------------------------------------------------------------
.../src/pubsub_udpmc_topic_sender.c | 17 +++++++++++++----
.../pubsub_admin_zmq/src/pubsub_zmq_topic_sender.c | 7 ++++++-
2 files changed, 19 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/celix/blob/3a5ff672/bundles/pubsub/pubsub_admin_udp_mc/src/pubsub_udpmc_topic_sender.c
----------------------------------------------------------------------
diff --git a/bundles/pubsub/pubsub_admin_udp_mc/src/pubsub_udpmc_topic_sender.c b/bundles/pubsub/pubsub_admin_udp_mc/src/pubsub_udpmc_topic_sender.c
index 1a75497..64d3d59 100644
--- a/bundles/pubsub/pubsub_admin_udp_mc/src/pubsub_udpmc_topic_sender.c
+++ b/bundles/pubsub/pubsub_admin_udp_mc/src/pubsub_udpmc_topic_sender.c
@@ -118,12 +118,21 @@ pubsub_udpmc_topic_sender_t* pubsub_udpmcTopicSender_create(
sender->publisher.factory.getService = psa_udpmc_getPublisherService;
sender->publisher.factory.ungetService = psa_udpmc_ungetPublisherService;
- celix_properties_t *props = celix_properties_create();
- celix_properties_set(props, PUBSUB_PUBLISHER_TOPIC, sender->topic);
- celix_properties_set(props, PUBSUB_PUBLISHER_SCOPE, sender->scope);
+ //register publisher factory service
+ {
+ celix_properties_t *props = celix_properties_create();
+ celix_properties_set(props, PUBSUB_PUBLISHER_TOPIC, sender->topic);
+ celix_properties_set(props, PUBSUB_PUBLISHER_SCOPE, sender->scope);
- sender->publisher.svcId = celix_bundleContext_registerServiceFactory(ctx, &sender->publisher.factory, PUBSUB_PUBLISHER_SERVICE_NAME, props);
+ celix_service_registration_options_t opts = CELIX_EMPTY_SERVICE_REGISTRATION_OPTIONS;
+ opts.factory = &sender->publisher.factory;
+ opts.serviceName = PUBSUB_PUBLISHER_SERVICE_NAME;
+ opts.serviceVersion = PUBSUB_PUBLISHER_SERVICE_VERSION;
+ opts.properties = props;
+
+ sender->publisher.svcId = celix_bundleContext_registerServiceWithOptions(ctx, &opts);
+ }
}
return sender;
http://git-wip-us.apache.org/repos/asf/celix/blob/3a5ff672/bundles/pubsub/pubsub_admin_zmq/src/pubsub_zmq_topic_sender.c
----------------------------------------------------------------------
diff --git a/bundles/pubsub/pubsub_admin_zmq/src/pubsub_zmq_topic_sender.c b/bundles/pubsub/pubsub_admin_zmq/src/pubsub_zmq_topic_sender.c
index 68c0e93..dc735c2 100644
--- a/bundles/pubsub/pubsub_admin_zmq/src/pubsub_zmq_topic_sender.c
+++ b/bundles/pubsub/pubsub_admin_zmq/src/pubsub_zmq_topic_sender.c
@@ -229,8 +229,13 @@ pubsub_zmq_topic_sender_t* pubsub_zmqTopicSender_create(
celix_properties_set(props, PUBSUB_PUBLISHER_TOPIC, sender->topic);
celix_properties_set(props, PUBSUB_PUBLISHER_SCOPE, sender->scope);
+ celix_service_registration_options_t opts = CELIX_EMPTY_SERVICE_REGISTRATION_OPTIONS;
+ opts.factory = &sender->publisher.factory;
+ opts.serviceName = PUBSUB_PUBLISHER_SERVICE_NAME;
+ opts.serviceVersion = PUBSUB_PUBLISHER_SERVICE_VERSION;
+ opts.properties = props;
- sender->publisher.svcId = celix_bundleContext_registerServiceFactory(ctx, &sender->publisher.factory, PUBSUB_PUBLISHER_SERVICE_NAME, props);
+ sender->publisher.svcId = celix_bundleContext_registerServiceWithOptions(ctx, &opts);
}
if (sender->url == NULL) {