This is an automated email from the ASF dual-hosted git repository. pengzheng pushed a commit to branch feature/556-osgi-uninstall in repository https://gitbox.apache.org/repos/asf/celix.git
commit 27383f6c7f7fe8b519bb9ebb9e6f6dc338294970 Author: PengZheng <[email protected]> AuthorDate: Fri Jun 2 11:40:51 2023 +0800 Update all bundle activator to use async service registration. --- bundles/http_admin/gtest/src/sut_activator.c | 8 ++++---- bundles/http_admin/http_admin/src/http_admin.c | 2 +- bundles/pubsub/integration/gtest/loopback_activator.c | 2 +- bundles/pubsub/integration/gtest/tst_endpoint_activator.c | 4 ++-- bundles/pubsub/pubsub_admin_tcp/src/psa_activator.c | 12 ++++++------ bundles/pubsub/pubsub_admin_udp_mc/src/psa_activator.c | 4 ++-- bundles/pubsub/pubsub_admin_websocket/src/psa_activator.c | 4 ++-- .../src/pubsub_websocket_topic_receiver.c | 4 ++-- .../src/pubsub_websocket_topic_sender.c | 4 ++-- bundles/pubsub/pubsub_admin_zmq/src/psa_activator.c | 4 ++-- bundles/pubsub/pubsub_discovery/src/psd_activator.c | 4 ++-- .../pubsub_protocol_wire_v1/src/ps_wire_protocol_activator.c | 2 +- .../src/ps_wire_v2_protocol_activator.c | 2 +- .../src/ps_avrobin_serializer_activator.c | 2 +- .../src/ps_json_serializer_activator.c | 2 +- bundles/pubsub/pubsub_topology_manager/src/pstm_activator.c | 4 ++-- .../examples/calculator_service/src/calculator_activator.c | 2 +- .../calculator_shell/src/calculator_shell_activator.c | 6 +++--- .../remote_example_service/src/remote_example_activator.c | 2 +- .../remote_example_service/src/remote_example_impl.c | 2 +- .../remote_service_admin_dfi/gtest/src/tst_activator.c | 2 +- .../src/remote_service_admin_activator.c | 2 +- bundles/shell/shell_wui/src/shell_wui_bundle_activator.c | 2 +- .../http_example/src/http_example_bundle_activator.c | 2 +- .../services_example_c/src/simple_provider_example.c | 2 +- .../celix-examples/track_tracker_example/src/activator.c | 2 +- 26 files changed, 44 insertions(+), 44 deletions(-) diff --git a/bundles/http_admin/gtest/src/sut_activator.c b/bundles/http_admin/gtest/src/sut_activator.c index 2c15da49..c35256cd 100644 --- a/bundles/http_admin/gtest/src/sut_activator.c +++ b/bundles/http_admin/gtest/src/sut_activator.c @@ -45,23 +45,23 @@ celix_status_t bnd_start(struct activator *act, celix_bundle_context_t *ctx) { celix_properties_set(props, HTTP_ADMIN_URI, "/alias"); act->httpSvc.handle = act; act->httpSvc.doPut = alias_test_put; - act->httpSvcId = celix_bundleContext_registerService(ctx, &act->httpSvc, HTTP_ADMIN_SERVICE_NAME, props); + act->httpSvcId = celix_bundleContext_registerServiceAsync(ctx, &act->httpSvc, HTTP_ADMIN_SERVICE_NAME, props); celix_properties_t *props2 = celix_properties_create(); celix_properties_set(props2, HTTP_ADMIN_URI, "/foo/bar"); act->httpSvc2.handle = act; - act->httpSvcId2 = celix_bundleContext_registerService(ctx, &act->httpSvc2, HTTP_ADMIN_SERVICE_NAME, props2); + act->httpSvcId2 = celix_bundleContext_registerServiceAsync(ctx, &act->httpSvc2, HTTP_ADMIN_SERVICE_NAME, props2); celix_properties_t *props3 = celix_properties_create(); celix_properties_set(props3, HTTP_ADMIN_URI, "/"); act->httpSvc3.handle = act; - act->httpSvcId3 = celix_bundleContext_registerService(ctx, &act->httpSvc3, HTTP_ADMIN_SERVICE_NAME, props3); + act->httpSvcId3 = celix_bundleContext_registerServiceAsync(ctx, &act->httpSvc3, HTTP_ADMIN_SERVICE_NAME, props3); celix_properties_t *props4 = celix_properties_create(); celix_properties_set(props4, WEBSOCKET_ADMIN_URI, "/"); act->sockSvc.handle = act; act->sockSvc.data = websocket_data_echo; - act->sockSvcId = celix_bundleContext_registerService(ctx, &act->sockSvc, WEBSOCKET_ADMIN_SERVICE_NAME, props4); + act->sockSvcId = celix_bundleContext_registerServiceAsync(ctx, &act->sockSvc, WEBSOCKET_ADMIN_SERVICE_NAME, props4); return CELIX_SUCCESS; } diff --git a/bundles/http_admin/http_admin/src/http_admin.c b/bundles/http_admin/http_admin/src/http_admin.c index b28f7e44..e20060da 100755 --- a/bundles/http_admin/http_admin/src/http_admin.c +++ b/bundles/http_admin/http_admin/src/http_admin.c @@ -374,7 +374,7 @@ static void httpAdmin_updateInfoSvc(http_admin_manager_t *admin) { if (resources_urls_size > 1) { celix_properties_set(properties, HTTP_ADMIN_INFO_RESOURCE_URLS, resources_urls); } - admin->infoSvcId = celix_bundleContext_registerService(admin->context, &admin->infoSvc, HTTP_ADMIN_INFO_SERVICE_NAME, properties); + admin->infoSvcId = celix_bundleContext_registerServiceAsync(admin->context, &admin->infoSvc, HTTP_ADMIN_INFO_SERVICE_NAME, properties); celixThreadMutex_unlock(&admin->admin_lock); diff --git a/bundles/pubsub/integration/gtest/loopback_activator.c b/bundles/pubsub/integration/gtest/loopback_activator.c index c718c4a7..a9d819c0 100644 --- a/bundles/pubsub/integration/gtest/loopback_activator.c +++ b/bundles/pubsub/integration/gtest/loopback_activator.c @@ -58,7 +58,7 @@ celix_status_t bnd_start(struct activator *act, celix_bundle_context_t *ctx) { celix_properties_set(props, PUBSUB_SUBSCRIBER_TOPIC, "pong2"); act->subSvc.handle = act; act->subSvc.receive = tst_receive; - act->subSvcId = celix_bundleContext_registerService(ctx, &act->subSvc, PUBSUB_SUBSCRIBER_SERVICE_NAME, props); + act->subSvcId = celix_bundleContext_registerServiceAsync(ctx, &act->subSvc, PUBSUB_SUBSCRIBER_SERVICE_NAME, props); return CELIX_SUCCESS; diff --git a/bundles/pubsub/integration/gtest/tst_endpoint_activator.c b/bundles/pubsub/integration/gtest/tst_endpoint_activator.c index e01a8ea8..bd8a23a6 100644 --- a/bundles/pubsub/integration/gtest/tst_endpoint_activator.c +++ b/bundles/pubsub/integration/gtest/tst_endpoint_activator.c @@ -51,14 +51,14 @@ celix_status_t bnd_start(struct activator *act, celix_bundle_context_t *ctx) { celix_properties_set(props, PUBSUB_SUBSCRIBER_TOPIC, "pong3"); act->subSvc.handle = act; act->subSvc.receive = tst_receive; - act->subSvcId = celix_bundleContext_registerService(ctx, &act->subSvc, PUBSUB_SUBSCRIBER_SERVICE_NAME, props); + act->subSvcId = celix_bundleContext_registerServiceAsync(ctx, &act->subSvc, PUBSUB_SUBSCRIBER_SERVICE_NAME, props); } { act->countSvc.handle = act; act->countSvc.receiveCount = tst_count; - act->countSvcId = celix_bundleContext_registerService(ctx, &act->countSvc, CELIX_RECEIVE_COUNT_SERVICE_NAME, NULL); + act->countSvcId = celix_bundleContext_registerServiceAsync(ctx, &act->countSvc, CELIX_RECEIVE_COUNT_SERVICE_NAME, NULL); } diff --git a/bundles/pubsub/pubsub_admin_tcp/src/psa_activator.c b/bundles/pubsub/pubsub_admin_tcp/src/psa_activator.c index 008cb7ce..cc13d703 100644 --- a/bundles/pubsub/pubsub_admin_tcp/src/psa_activator.c +++ b/bundles/pubsub/pubsub_admin_tcp/src/psa_activator.c @@ -83,7 +83,7 @@ int psa_tcp_start(psa_tcp_activator_t *act, celix_bundle_context_t *ctx) { celix_properties_t *props = celix_properties_create(); celix_properties_set(props, PUBSUB_ADMIN_SERVICE_TYPE, PUBSUB_TCP_ADMIN_TYPE); - act->adminSvcId = celix_bundleContext_registerService(ctx, psaSvc, PUBSUB_ADMIN_SERVICE_NAME, props); + act->adminSvcId = celix_bundleContext_registerServiceAsync(ctx, psaSvc, PUBSUB_ADMIN_SERVICE_NAME, props); } if (status == CELIX_SUCCESS) { @@ -94,10 +94,10 @@ int psa_tcp_start(psa_tcp_activator_t *act, celix_bundle_context_t *ctx) { celix_properties_set(props, PUBSUB_ADMIN_SERVICE_TYPE, PUBSUB_TCP_ADMIN_TYPE); act->adminMetricsSvcId = - celix_bundleContext_registerService(ctx, - &act->adminMetricsService, - PUBSUB_ADMIN_METRICS_SERVICE_NAME, - props); + celix_bundleContext_registerServiceAsync(ctx, + &act->adminMetricsService, + PUBSUB_ADMIN_METRICS_SERVICE_NAME, + props); } //register shell command service @@ -108,7 +108,7 @@ int psa_tcp_start(psa_tcp_activator_t *act, celix_bundle_context_t *ctx) { celix_properties_set(props, CELIX_SHELL_COMMAND_NAME, "celix::psa_tcp"); celix_properties_set(props, CELIX_SHELL_COMMAND_USAGE, "psa_tcp"); celix_properties_set(props, CELIX_SHELL_COMMAND_DESCRIPTION, "Print the information about the TopicSender and TopicReceivers for the TCP PSA"); - act->cmdSvcId = celix_bundleContext_registerService(ctx, &act->cmdSvc, CELIX_SHELL_COMMAND_SERVICE_NAME, props); + act->cmdSvcId = celix_bundleContext_registerServiceAsync(ctx, &act->cmdSvc, CELIX_SHELL_COMMAND_SERVICE_NAME, props); } return status; diff --git a/bundles/pubsub/pubsub_admin_udp_mc/src/psa_activator.c b/bundles/pubsub/pubsub_admin_udp_mc/src/psa_activator.c index 0cc543c5..e9058a3a 100644 --- a/bundles/pubsub/pubsub_admin_udp_mc/src/psa_activator.c +++ b/bundles/pubsub/pubsub_admin_udp_mc/src/psa_activator.c @@ -80,7 +80,7 @@ int psa_udpmc_start(psa_udpmc_activator_t *act, celix_bundle_context_t *ctx) { celix_properties_t *props = celix_properties_create(); celix_properties_set(props, PUBSUB_ADMIN_SERVICE_TYPE, PUBSUB_UDPMC_ADMIN_TYPE); - act->adminSvcId = celix_bundleContext_registerService(ctx, psaSvc, PUBSUB_ADMIN_SERVICE_NAME, props); + act->adminSvcId = celix_bundleContext_registerServiceAsync(ctx, psaSvc, PUBSUB_ADMIN_SERVICE_NAME, props); } //register shell command service @@ -91,7 +91,7 @@ int psa_udpmc_start(psa_udpmc_activator_t *act, celix_bundle_context_t *ctx) { celix_properties_set(props, CELIX_SHELL_COMMAND_NAME, "celix::psa_udpmc"); celix_properties_set(props, CELIX_SHELL_COMMAND_USAGE, "psa_udpmc"); celix_properties_set(props, CELIX_SHELL_COMMAND_DESCRIPTION, "Print the information about the TopicSender and TopicReceivers for the UDPMC PSA"); - act->cmdSvcId = celix_bundleContext_registerService(ctx, &act->cmdSvc, CELIX_SHELL_COMMAND_SERVICE_NAME, props); + act->cmdSvcId = celix_bundleContext_registerServiceAsync(ctx, &act->cmdSvc, CELIX_SHELL_COMMAND_SERVICE_NAME, props); } return status; diff --git a/bundles/pubsub/pubsub_admin_websocket/src/psa_activator.c b/bundles/pubsub/pubsub_admin_websocket/src/psa_activator.c index 33cc86f3..2a41fa50 100644 --- a/bundles/pubsub/pubsub_admin_websocket/src/psa_activator.c +++ b/bundles/pubsub/pubsub_admin_websocket/src/psa_activator.c @@ -70,7 +70,7 @@ int psa_websocket_start(psa_websocket_activator_t *act, celix_bundle_context_t * celix_properties_t *props = celix_properties_create(); celix_properties_set(props, PUBSUB_ADMIN_SERVICE_TYPE, PUBSUB_WEBSOCKET_ADMIN_TYPE); - act->adminSvcId = celix_bundleContext_registerService(ctx, psaSvc, PUBSUB_ADMIN_SERVICE_NAME, props); + act->adminSvcId = celix_bundleContext_registerServiceAsync(ctx, psaSvc, PUBSUB_ADMIN_SERVICE_NAME, props); } //register shell command service @@ -81,7 +81,7 @@ int psa_websocket_start(psa_websocket_activator_t *act, celix_bundle_context_t * celix_properties_set(props, CELIX_SHELL_COMMAND_NAME, "celix::psa_websocket"); celix_properties_set(props, CELIX_SHELL_COMMAND_USAGE, "psa_websocket"); celix_properties_set(props, CELIX_SHELL_COMMAND_DESCRIPTION, "Print the information about the TopicSender and TopicReceivers for the websocket PSA"); - act->cmdSvcId = celix_bundleContext_registerService(ctx, &act->cmdSvc, CELIX_SHELL_COMMAND_SERVICE_NAME, props); + act->cmdSvcId = celix_bundleContext_registerServiceAsync(ctx, &act->cmdSvc, CELIX_SHELL_COMMAND_SERVICE_NAME, props); } return status; diff --git a/bundles/pubsub/pubsub_admin_websocket/src/pubsub_websocket_topic_receiver.c b/bundles/pubsub/pubsub_admin_websocket/src/pubsub_websocket_topic_receiver.c index e163a7ca..9dc5fd78 100644 --- a/bundles/pubsub/pubsub_admin_websocket/src/pubsub_websocket_topic_receiver.c +++ b/bundles/pubsub/pubsub_admin_websocket/src/pubsub_websocket_topic_receiver.c @@ -193,8 +193,8 @@ pubsub_websocket_topic_receiver_t* pubsub_websocketTopicReceiver_create(celix_bu receiver->sockSvc.ready = psa_websocketTopicReceiver_ready; receiver->sockSvc.data = psa_websocketTopicReceiver_data; receiver->sockSvc.close = psa_websocketTopicReceiver_close; - receiver->svcId = celix_bundleContext_registerService(receiver->ctx, &receiver->sockSvc, - WEBSOCKET_ADMIN_SERVICE_NAME, props); + receiver->svcId = celix_bundleContext_registerServiceAsync(receiver->ctx, &receiver->sockSvc, + WEBSOCKET_ADMIN_SERVICE_NAME, props); } const char *staticConnects = pubsub_getEnvironmentVariableWithScopeTopic(ctx, PUBSUB_WEBSOCKET_STATIC_CONNECT_SOCKET_ADDRESSES_FOR, topic, scope); diff --git a/bundles/pubsub/pubsub_admin_websocket/src/pubsub_websocket_topic_sender.c b/bundles/pubsub/pubsub_admin_websocket/src/pubsub_websocket_topic_sender.c index e8ab0623..eb1dc6b1 100644 --- a/bundles/pubsub/pubsub_admin_websocket/src/pubsub_websocket_topic_sender.c +++ b/bundles/pubsub/pubsub_admin_websocket/src/pubsub_websocket_topic_sender.c @@ -115,8 +115,8 @@ pubsub_websocket_topic_sender_t* pubsub_websocketTopicSender_create( sender->websockSvc.handle = sender; sender->websockSvc.ready = psa_websocketTopicSender_ready; sender->websockSvc.close = psa_websocketTopicSender_close; - sender->websockSvcId = celix_bundleContext_registerService(ctx, &sender->websockSvc, - WEBSOCKET_ADMIN_SERVICE_NAME, props); + sender->websockSvcId = celix_bundleContext_registerServiceAsync(ctx, &sender->websockSvc, + WEBSOCKET_ADMIN_SERVICE_NAME, props); } else { sender->websockSvcId = -1; } diff --git a/bundles/pubsub/pubsub_admin_zmq/src/psa_activator.c b/bundles/pubsub/pubsub_admin_zmq/src/psa_activator.c index 913ad34d..3943ff78 100644 --- a/bundles/pubsub/pubsub_admin_zmq/src/psa_activator.c +++ b/bundles/pubsub/pubsub_admin_zmq/src/psa_activator.c @@ -84,7 +84,7 @@ int psa_zmq_start(psa_zmq_activator_t *act, celix_bundle_context_t *ctx) { celix_properties_t *props = celix_properties_create(); celix_properties_set(props, PUBSUB_ADMIN_SERVICE_TYPE, PUBSUB_ZMQ_ADMIN_TYPE); - act->adminSvcId = celix_bundleContext_registerService(ctx, psaSvc, PUBSUB_ADMIN_SERVICE_NAME, props); + act->adminSvcId = celix_bundleContext_registerServiceAsync(ctx, psaSvc, PUBSUB_ADMIN_SERVICE_NAME, props); } //register shell command service @@ -95,7 +95,7 @@ int psa_zmq_start(psa_zmq_activator_t *act, celix_bundle_context_t *ctx) { celix_properties_set(props, CELIX_SHELL_COMMAND_NAME, "celix::psa_zmq"); celix_properties_set(props, CELIX_SHELL_COMMAND_USAGE, "psa_zmq"); celix_properties_set(props, CELIX_SHELL_COMMAND_DESCRIPTION, "Print the information about the TopicSender and TopicReceivers for the ZMQ PSA"); - act->cmdSvcId = celix_bundleContext_registerService(ctx, &act->cmdSvc, CELIX_SHELL_COMMAND_SERVICE_NAME, props); + act->cmdSvcId = celix_bundleContext_registerServiceAsync(ctx, &act->cmdSvc, CELIX_SHELL_COMMAND_SERVICE_NAME, props); } return status; diff --git a/bundles/pubsub/pubsub_discovery/src/psd_activator.c b/bundles/pubsub/pubsub_discovery/src/psd_activator.c index d19cb0f1..0aaa3593 100644 --- a/bundles/pubsub/pubsub_discovery/src/psd_activator.c +++ b/bundles/pubsub/pubsub_discovery/src/psd_activator.c @@ -76,11 +76,11 @@ static celix_status_t psd_start(psd_activator_t *act, celix_bundle_context_t *ct celix_properties_set(props, CELIX_SHELL_COMMAND_NAME, "celix::psd_etcd"); celix_properties_set(props, CELIX_SHELL_COMMAND_USAGE, "psd_etcd"); celix_properties_set(props, CELIX_SHELL_COMMAND_DESCRIPTION, "Overview of discovered/announced endpoints from/to ETCD"); - act->cmdSvcId = celix_bundleContext_registerService(ctx, &act->cmdSvc, CELIX_SHELL_COMMAND_SERVICE_NAME, props); + act->cmdSvcId = celix_bundleContext_registerServiceAsync(ctx, &act->cmdSvc, CELIX_SHELL_COMMAND_SERVICE_NAME, props); } if (status == CELIX_SUCCESS) { - act->listenerSvcId = celix_bundleContext_registerService(ctx, &act->listenerSvc, PUBSUB_ANNOUNCE_ENDPOINT_LISTENER_SERVICE, NULL); + act->listenerSvcId = celix_bundleContext_registerServiceAsync(ctx, &act->listenerSvc, PUBSUB_ANNOUNCE_ENDPOINT_LISTENER_SERVICE, NULL); } else { act->listenerSvcId = -1L; } diff --git a/bundles/pubsub/pubsub_protocol/pubsub_protocol_wire_v1/src/ps_wire_protocol_activator.c b/bundles/pubsub/pubsub_protocol/pubsub_protocol_wire_v1/src/ps_wire_protocol_activator.c index 64abebec..03b130f8 100644 --- a/bundles/pubsub/pubsub_protocol/pubsub_protocol_wire_v1/src/ps_wire_protocol_activator.c +++ b/bundles/pubsub/pubsub_protocol/pubsub_protocol_wire_v1/src/ps_wire_protocol_activator.c @@ -57,7 +57,7 @@ static int ps_wp_start(ps_wp_activator_t *act, celix_bundle_context_t *ctx) { act->protocolSvc.decodeMetadata = pubsubProtocol_v1_decodeMetadata; act->protocolSvc.decodeFooter = pubsubProtocol_decodeFooter; - act->wireProtocolSvcId = celix_bundleContext_registerService(ctx, &act->protocolSvc, PUBSUB_PROTOCOL_SERVICE_NAME, props); + act->wireProtocolSvcId = celix_bundleContext_registerServiceAsync(ctx, &act->protocolSvc, PUBSUB_PROTOCOL_SERVICE_NAME, props); } return status; } diff --git a/bundles/pubsub/pubsub_protocol/pubsub_protocol_wire_v2/src/ps_wire_v2_protocol_activator.c b/bundles/pubsub/pubsub_protocol/pubsub_protocol_wire_v2/src/ps_wire_v2_protocol_activator.c index 86708eba..0b884123 100644 --- a/bundles/pubsub/pubsub_protocol/pubsub_protocol_wire_v2/src/ps_wire_v2_protocol_activator.c +++ b/bundles/pubsub/pubsub_protocol/pubsub_protocol_wire_v2/src/ps_wire_v2_protocol_activator.c @@ -58,7 +58,7 @@ static int ps_wp_start(ps_wp_activator_t *act, celix_bundle_context_t *ctx) { act->protocolSvc.decodeMetadata = pubsubProtocol_wire_v2_decodeMetadata; act->protocolSvc.decodeFooter = pubsubProtocol_wire_v2_decodeFooter; - act->wireProtocolSvcId = celix_bundleContext_registerService(ctx, &act->protocolSvc, PUBSUB_PROTOCOL_SERVICE_NAME, props); + act->wireProtocolSvcId = celix_bundleContext_registerServiceAsync(ctx, &act->protocolSvc, PUBSUB_PROTOCOL_SERVICE_NAME, props); } return status; } diff --git a/bundles/pubsub/pubsub_serializer_avrobin/src/ps_avrobin_serializer_activator.c b/bundles/pubsub/pubsub_serializer_avrobin/src/ps_avrobin_serializer_activator.c index 275a72da..11cfe152 100644 --- a/bundles/pubsub/pubsub_serializer_avrobin/src/ps_avrobin_serializer_activator.c +++ b/bundles/pubsub/pubsub_serializer_avrobin/src/ps_avrobin_serializer_activator.c @@ -46,7 +46,7 @@ static int psav_start(psav_activator_t *act, celix_bundle_context_t *ctx) { celix_properties_t *props = celix_properties_create(); celix_properties_set(props, PUBSUB_SERIALIZER_TYPE_KEY, PUBSUB_AVROBIN_SERIALIZER_TYPE); - act->serializerSvcId = celix_bundleContext_registerService(ctx, &act->serializerSvc, PUBSUB_SERIALIZER_SERVICE_NAME, props); + act->serializerSvcId = celix_bundleContext_registerServiceAsync(ctx, &act->serializerSvc, PUBSUB_SERIALIZER_SERVICE_NAME, props); } return status; } diff --git a/bundles/pubsub/pubsub_serializer_json/src/ps_json_serializer_activator.c b/bundles/pubsub/pubsub_serializer_json/src/ps_json_serializer_activator.c index 9df8e13f..afb62505 100644 --- a/bundles/pubsub/pubsub_serializer_json/src/ps_json_serializer_activator.c +++ b/bundles/pubsub/pubsub_serializer_json/src/ps_json_serializer_activator.c @@ -44,7 +44,7 @@ static int psjs_start(psjs_activator_t *act, celix_bundle_context_t *ctx) { /* Set serializer type */ celix_properties_t *props = celix_properties_create(); celix_properties_set(props, PUBSUB_SERIALIZER_TYPE_KEY, PUBSUB_JSON_SERIALIZER_TYPE); - act->serializerSvcId = celix_bundleContext_registerService(ctx, &act->serializerSvc, PUBSUB_SERIALIZER_SERVICE_NAME, props); + act->serializerSvcId = celix_bundleContext_registerServiceAsync(ctx, &act->serializerSvc, PUBSUB_SERIALIZER_SERVICE_NAME, props); } return status; diff --git a/bundles/pubsub/pubsub_topology_manager/src/pstm_activator.c b/bundles/pubsub/pubsub_topology_manager/src/pstm_activator.c index 347d6471..1bdfc69f 100644 --- a/bundles/pubsub/pubsub_topology_manager/src/pstm_activator.c +++ b/bundles/pubsub/pubsub_topology_manager/src/pstm_activator.c @@ -118,7 +118,7 @@ static int pstm_start(pstm_activator_t *act, celix_bundle_context_t *ctx) { act->discListenerSvc.handle = act->manager; act->discListenerSvc.addDiscoveredEndpoint = pubsub_topologyManager_addDiscoveredEndpoint; act->discListenerSvc.removeDiscoveredEndpoint = pubsub_topologyManager_removeDiscoveredEndpoint; - act->discListenerSvcId = celix_bundleContext_registerService(ctx, &act->discListenerSvc, PUBSUB_DISCOVERED_ENDPOINT_LISTENER_SERVICE, NULL); + act->discListenerSvcId = celix_bundleContext_registerServiceAsync(ctx, &act->discListenerSvc, PUBSUB_DISCOVERED_ENDPOINT_LISTENER_SERVICE, NULL); } //register shell command @@ -129,7 +129,7 @@ static int pstm_start(pstm_activator_t *act, celix_bundle_context_t *ctx) { celix_properties_set(props, CELIX_SHELL_COMMAND_NAME, "celix::pstm"); celix_properties_set(props, CELIX_SHELL_COMMAND_USAGE, "pstm [topology|metrics]"); //TODO add search topic/scope option celix_properties_set(props, CELIX_SHELL_COMMAND_DESCRIPTION, "pubsub_topology_info: Overview of Topology information for PubSub"); - act->shellCmdSvcId = celix_bundleContext_registerService(ctx, &act->shellCmdSvc, CELIX_SHELL_COMMAND_SERVICE_NAME, props); + act->shellCmdSvcId = celix_bundleContext_registerServiceAsync(ctx, &act->shellCmdSvc, CELIX_SHELL_COMMAND_SERVICE_NAME, props); } //TODO add tracker for pubsub_serializer and diff --git a/bundles/remote_services/examples/calculator_service/src/calculator_activator.c b/bundles/remote_services/examples/calculator_service/src/calculator_activator.c index 261169e0..e39aa484 100644 --- a/bundles/remote_services/examples/calculator_service/src/calculator_activator.c +++ b/bundles/remote_services/examples/calculator_service/src/calculator_activator.c @@ -44,7 +44,7 @@ celix_status_t calculatorBndStart(struct activator *act, celix_bundle_context_t celix_properties_set(properties, CELIX_FRAMEWORK_SERVICE_VERSION, CALCULATOR_SERVICE_VERSION); celix_properties_set(properties, OSGI_RSA_SERVICE_EXPORTED_CONFIGS, CALCULATOR_CONFIGURATION_TYPE); - act->svcId = celix_bundleContext_registerService(ctx, &act->service, CALCULATOR_SERVICE, properties); + act->svcId = celix_bundleContext_registerServiceAsync(ctx, &act->service, CALCULATOR_SERVICE, properties); } return CELIX_SUCCESS; } diff --git a/bundles/remote_services/examples/calculator_shell/src/calculator_shell_activator.c b/bundles/remote_services/examples/calculator_shell/src/calculator_shell_activator.c index 31e5c49a..523dab09 100644 --- a/bundles/remote_services/examples/calculator_shell/src/calculator_shell_activator.c +++ b/bundles/remote_services/examples/calculator_shell/src/calculator_shell_activator.c @@ -42,19 +42,19 @@ static celix_status_t calcShell_start(calc_shell_activator_t *activator, celix_b activator->addCmd.executeCommand = addCommand_execute; celix_properties_t *props = celix_properties_create(); celix_properties_set(props, CELIX_SHELL_COMMAND_NAME, "add"); - activator->addCmdSvcId = celix_bundleContext_registerService(ctx, &activator->addCmd, CELIX_SHELL_COMMAND_SERVICE_NAME, props); + activator->addCmdSvcId = celix_bundleContext_registerServiceAsync(ctx, &activator->addCmd, CELIX_SHELL_COMMAND_SERVICE_NAME, props); activator->subCmd.handle = ctx; activator->subCmd.executeCommand = subCommand_execute; props = celix_properties_create(); celix_properties_set(props, CELIX_SHELL_COMMAND_NAME, "sub"); - activator->subCmdSvcId = celix_bundleContext_registerService(ctx, &activator->subCmd, CELIX_SHELL_COMMAND_SERVICE_NAME, props); + activator->subCmdSvcId = celix_bundleContext_registerServiceAsync(ctx, &activator->subCmd, CELIX_SHELL_COMMAND_SERVICE_NAME, props); activator->sqrtCmd.handle = ctx; activator->sqrtCmd.executeCommand = sqrtCommand_execute; props = celix_properties_create(); celix_properties_set(props, CELIX_SHELL_COMMAND_NAME, "sqrt"); - activator->sqrtCmdSvcId = celix_bundleContext_registerService(ctx, &activator->sqrtCmd, CELIX_SHELL_COMMAND_SERVICE_NAME, props); + activator->sqrtCmdSvcId = celix_bundleContext_registerServiceAsync(ctx, &activator->sqrtCmd, CELIX_SHELL_COMMAND_SERVICE_NAME, props); return CELIX_SUCCESS; } diff --git a/bundles/remote_services/examples/remote_example_service/src/remote_example_activator.c b/bundles/remote_services/examples/remote_example_service/src/remote_example_activator.c index 59522e30..d40163ee 100644 --- a/bundles/remote_services/examples/remote_example_service/src/remote_example_activator.c +++ b/bundles/remote_services/examples/remote_example_service/src/remote_example_activator.c @@ -46,7 +46,7 @@ celix_status_t remoteExampleBndStart(struct activator *act, celix_bundle_context celix_properties_t *properties = celix_properties_create(); celix_properties_set(properties, OSGI_RSA_SERVICE_EXPORTED_INTERFACES, REMOTE_EXAMPLE_NAME); - act->svcId = celix_bundleContext_registerService(ctx, &act->service, REMOTE_EXAMPLE_NAME, properties); + act->svcId = celix_bundleContext_registerServiceAsync(ctx, &act->service, REMOTE_EXAMPLE_NAME, properties); } return CELIX_SUCCESS; } diff --git a/bundles/remote_services/examples/remote_example_service/src/remote_example_impl.c b/bundles/remote_services/examples/remote_example_service/src/remote_example_impl.c index f462d342..a18b4d2d 100644 --- a/bundles/remote_services/examples/remote_example_service/src/remote_example_impl.c +++ b/bundles/remote_services/examples/remote_example_service/src/remote_example_impl.c @@ -161,7 +161,7 @@ int remoteExample_createAdditionalRemoteService(remote_example_impl_t* impl) { } else { celix_properties_t *properties = celix_properties_create(); celix_properties_set(properties, OSGI_RSA_SERVICE_EXPORTED_INTERFACES, REMOTE_EXAMPLE_NAME); - long newSvcId = celix_bundleContext_registerService(impl->ctx, &impl->additionalSvc, REMOTE_EXAMPLE_NAME, properties); + long newSvcId = celix_bundleContext_registerServiceAsync(impl->ctx, &impl->additionalSvc, REMOTE_EXAMPLE_NAME, properties); pthread_mutex_lock(&impl->mutex); prevSvcId = impl->additionalSvcId; if (prevSvcId == -1L) { diff --git a/bundles/remote_services/remote_service_admin_dfi/gtest/src/tst_activator.c b/bundles/remote_services/remote_service_admin_dfi/gtest/src/tst_activator.c index a571f1d0..66a977e5 100644 --- a/bundles/remote_services/remote_service_admin_dfi/gtest/src/tst_activator.c +++ b/bundles/remote_services/remote_service_admin_dfi/gtest/src/tst_activator.c @@ -360,7 +360,7 @@ static celix_status_t bndStart(struct activator *act, celix_bundle_context_t* ct } //register test service - act->svcId = celix_bundleContext_registerService(ctx, &act->testSvc, TST_SERVICE_NAME, NULL); + act->svcId = celix_bundleContext_registerServiceAsync(ctx, &act->testSvc, TST_SERVICE_NAME, NULL); return CELIX_SUCCESS; } diff --git a/bundles/remote_services/remote_service_admin_dfi/src/remote_service_admin_activator.c b/bundles/remote_services/remote_service_admin_dfi/src/remote_service_admin_activator.c index 0b470da7..a81ea815 100644 --- a/bundles/remote_services/remote_service_admin_dfi/src/remote_service_admin_activator.c +++ b/bundles/remote_services/remote_service_admin_dfi/src/remote_service_admin_activator.c @@ -56,7 +56,7 @@ static celix_status_t celix_rsa_start(celix_remote_service_admin_activator_t* ac activator->adminService.importRegistration_getException = importRegistration_getException; activator->adminService.importRegistration_getImportReference = importRegistration_getImportReference; - activator->svcIdRsa = celix_bundleContext_registerService(ctx, &activator->adminService, OSGI_RSA_REMOTE_SERVICE_ADMIN, NULL); + activator->svcIdRsa = celix_bundleContext_registerServiceAsync(ctx, &activator->adminService, OSGI_RSA_REMOTE_SERVICE_ADMIN, NULL); } return status; diff --git a/bundles/shell/shell_wui/src/shell_wui_bundle_activator.c b/bundles/shell/shell_wui/src/shell_wui_bundle_activator.c index d2bfac3b..b9c46c86 100644 --- a/bundles/shell/shell_wui/src/shell_wui_bundle_activator.c +++ b/bundles/shell/shell_wui/src/shell_wui_bundle_activator.c @@ -77,7 +77,7 @@ static celix_status_t shellWui_activator_start(shell_wui_activator_data_t *data, celix_properties_set(props, WEBSOCKET_ADMIN_URI, "/shell/socket"); data->sockSvc.handle = data; data->sockSvc.data = websocket_data_handler; - data->sockSvcId = celix_bundleContext_registerService(ctx, &data->sockSvc, WEBSOCKET_ADMIN_SERVICE_NAME, props); + data->sockSvcId = celix_bundleContext_registerServiceAsync(ctx, &data->sockSvc, WEBSOCKET_ADMIN_SERVICE_NAME, props); return CELIX_SUCCESS; } diff --git a/examples/celix-examples/http_example/src/http_example_bundle_activator.c b/examples/celix-examples/http_example/src/http_example_bundle_activator.c index 923eda6b..5142958b 100644 --- a/examples/celix-examples/http_example/src/http_example_bundle_activator.c +++ b/examples/celix-examples/http_example/src/http_example_bundle_activator.c @@ -47,7 +47,7 @@ static celix_status_t httpExample_activator_start(http_example_activator_data_t celix_properties_set(props, WEBSOCKET_ADMIN_URI, "/hello/socket"); data->sockSvc.handle = data; data->sockSvc.ready = websocket_ready_handler; - data->sockSvcId = celix_bundleContext_registerService(ctx, &data->sockSvc, WEBSOCKET_ADMIN_SERVICE_NAME, props); + data->sockSvcId = celix_bundleContext_registerServiceAsync(ctx, &data->sockSvc, WEBSOCKET_ADMIN_SERVICE_NAME, props); return CELIX_SUCCESS; } diff --git a/examples/celix-examples/services_example_c/src/simple_provider_example.c b/examples/celix-examples/services_example_c/src/simple_provider_example.c index 9f1b95c2..d23ac9b4 100644 --- a/examples/celix-examples/services_example_c/src/simple_provider_example.c +++ b/examples/celix-examples/services_example_c/src/simple_provider_example.c @@ -40,7 +40,7 @@ static celix_status_t activator_start(activator_data_t *data, celix_bundle_conte data->seed = 42; data->svcId = -1L; - data->svcId = celix_bundleContext_registerService(ctx, &data->svc, EXAMPLE_CALC_NAME, NULL); + data->svcId = celix_bundleContext_registerServiceAsync(ctx, &data->svc, EXAMPLE_CALC_NAME, NULL); printf("Registered calc service with service id %li\n", data->svcId); return CELIX_SUCCESS; diff --git a/examples/celix-examples/track_tracker_example/src/activator.c b/examples/celix-examples/track_tracker_example/src/activator.c index c5a05e57..1334a7c2 100644 --- a/examples/celix-examples/track_tracker_example/src/activator.c +++ b/examples/celix-examples/track_tracker_example/src/activator.c @@ -86,7 +86,7 @@ celix_status_t activator_start(activator_data_t* act, celix_bundle_context_t *ct act->svc.handle = act; act->svc.calc = calc; //note only triggers on calcTrk1, because of filter restrictions - act->svcId = celix_bundleContext_registerService(ctx, &act->svc, CALC_SERVICE_NAME, NULL); + act->svcId = celix_bundleContext_registerServiceAsync(ctx, &act->svc, CALC_SERVICE_NAME, NULL); return CELIX_SUCCESS; }
