This is an automated email from the ASF dual-hosted git repository. pnoltes pushed a commit to branch feature/509-remove-osgi-defines in repository https://gitbox.apache.org/repos/asf/celix.git
commit efaa16bd96ed171335056aab4aea48f86786d1cb Author: Pepijn Noltes <[email protected]> AuthorDate: Sat Oct 28 19:08:05 2023 +0200 #509: Remove CELIX_FRAMEWORK_SERVICE_PID from celix_constants.h --- libs/framework/include/celix_constants.h | 2 -- .../bundles/config_admin/service/private/src/configuration_impl.c | 8 ++++---- .../config_admin/service/private/src/managed_service_tracker.c | 4 ++-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/libs/framework/include/celix_constants.h b/libs/framework/include/celix_constants.h index eb506ec2..c6895c63 100644 --- a/libs/framework/include/celix_constants.h +++ b/libs/framework/include/celix_constants.h @@ -76,8 +76,6 @@ extern "C" { */ #define CELIX_FRAMEWORK_SERVICE_SCOPE_BUNDLE "bundle" -#define CELIX_FRAMEWORK_SERVICE_PID "service.pid" - /** * @brief The bundle id (value 0) used to identify the Celix framework. */ diff --git a/misc/experimental/bundles/config_admin/service/private/src/configuration_impl.c b/misc/experimental/bundles/config_admin/service/private/src/configuration_impl.c index b6ef5c6d..49aa9bdf 100644 --- a/misc/experimental/bundles/config_admin/service/private/src/configuration_impl.c +++ b/misc/experimental/bundles/config_admin/service/private/src/configuration_impl.c @@ -202,7 +202,7 @@ celix_status_t configuration_create2(configuration_admin_factory_pt factory, con conf_impl->factoryPid = strdup(value); else conf_impl->factoryPid = NULL; - value = properties_get(dictionary, (char *)CELIX_FRAMEWORK_SERVICE_PID); + value = properties_get(dictionary, (char *)"service.pid"); if (value != NULL) conf_impl->pid = strdup(value); else @@ -598,7 +598,7 @@ celix_status_t configuration_updateDictionary(configuration_impl_pt configuratio if ( newDictionary != NULL ){ - hashMap_remove(newDictionary, (void *) CELIX_FRAMEWORK_SERVICE_PID); + hashMap_remove(newDictionary, (void *) "service.pid"); hashMap_remove(newDictionary, (void *) SERVICE_FACTORYPID); hashMap_remove(newDictionary, (void *) SERVICE_BUNDLELOCATION); } @@ -636,8 +636,8 @@ celix_status_t configuration_setAutoProperties(configuration_impl_pt configurati configuration_lock(configuration); // (2) set service.pid -// if (properties_get(*properties, (char*)CELIX_FRAMEWORK_SERVICE_PID) != NULL) { - properties_set(*properties, (char*)CELIX_FRAMEWORK_SERVICE_PID, configuration->pid); +// if (properties_get(*properties, (char*)"service.pid") != NULL) { + properties_set(*properties, (char*)"service.pid", configuration->pid); // } // (3) set factory.pid diff --git a/misc/experimental/bundles/config_admin/service/private/src/managed_service_tracker.c b/misc/experimental/bundles/config_admin/service/private/src/managed_service_tracker.c index e667d9dd..ef77fc11 100644 --- a/misc/experimental/bundles/config_admin/service/private/src/managed_service_tracker.c +++ b/misc/experimental/bundles/config_admin/service/private/src/managed_service_tracker.c @@ -211,7 +211,7 @@ celix_status_t managedServiceTracker_addingService(void * handle, service_refere // (1) reference.getPid - status = serviceReference_getProperty(reference, CELIX_FRAMEWORK_SERVICE_PID, &pid); + status = serviceReference_getProperty(reference, "service.pid", &pid); if (status != CELIX_SUCCESS || pid == NULL) { *service = NULL; printf(" [ ERROR ]: Tracker - PID is NULL \n"); @@ -286,7 +286,7 @@ celix_status_t managedServiceTracker_removedService(void * handle, service_refer bundle_context_pt context; - status = serviceReference_getProperty(reference, CELIX_FRAMEWORK_SERVICE_PID, &pid); + status = serviceReference_getProperty(reference, "service.pid", &pid); if (status != CELIX_SUCCESS || pid == NULL){ return CELIX_ILLEGAL_ARGUMENT; }
