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 27c8e913272209c28333097594836ef2f9272caf Author: Pepijn Noltes <[email protected]> AuthorDate: Sun Oct 29 11:28:22 2023 +0100 #509: Remove deprecated bundle_activator.h header and its usage --- .../discovery_common/src/discovery_activator.c | 12 +-- .../tms_tst/bundle/tst_activator.c | 6 +- .../tms_tst/disc_mock/disc_mock_activator.c | 10 +- .../tms_tst/disc_mock/disc_mock_service.c | 1 - .../include_deprecated/bundle_activator.h | 113 --------------------- 5 files changed, 14 insertions(+), 128 deletions(-) diff --git a/bundles/remote_services/discovery_common/src/discovery_activator.c b/bundles/remote_services/discovery_common/src/discovery_activator.c index 751d95ec..c3038bad 100644 --- a/bundles/remote_services/discovery_common/src/discovery_activator.c +++ b/bundles/remote_services/discovery_common/src/discovery_activator.c @@ -29,7 +29,7 @@ #include <string.h> -#include "bundle_activator.h" +#include "celix_bundle_activator.h" #include "service_tracker.h" #include "celix_constants.h" @@ -62,7 +62,7 @@ celix_status_t bundleActivator_createEPLTracker(struct activator *activator, ser return status; } -celix_status_t bundleActivator_create(celix_bundle_context_t *context, void **userData) { +celix_status_t celix_bundleActivator_create(celix_bundle_context_t *context, void **userData) { celix_status_t status; struct activator* activator = calloc(1,sizeof(struct activator)); @@ -81,7 +81,7 @@ celix_status_t bundleActivator_create(celix_bundle_context_t *context, void **us *userData = activator; } else{ - bundleActivator_destroy(activator,context); + celix_bundleActivator_destroy(activator,context); } } else{ @@ -91,7 +91,7 @@ celix_status_t bundleActivator_create(celix_bundle_context_t *context, void **us return status; } -celix_status_t bundleActivator_start(void * userData, celix_bundle_context_t *context) { +celix_status_t celix_bundleActivator_start(void * userData, celix_bundle_context_t *context) { celix_status_t status; struct activator *activator = userData; const char *uuid = NULL; @@ -147,7 +147,7 @@ celix_status_t bundleActivator_start(void * userData, celix_bundle_context_t *co return status; } -celix_status_t bundleActivator_stop(void * userData, celix_bundle_context_t *context) { +celix_status_t celix_bundleActivator_stop(void * userData, celix_bundle_context_t *context) { celix_status_t status; struct activator *activator = userData; @@ -161,7 +161,7 @@ celix_status_t bundleActivator_stop(void * userData, celix_bundle_context_t *con return status; } -celix_status_t bundleActivator_destroy(void * userData, celix_bundle_context_t *context) { +celix_status_t celix_bundleActivator_destroy(void * userData, celix_bundle_context_t *context) { celix_status_t status; struct activator *activator = userData; diff --git a/bundles/remote_services/topology_manager/tms_tst/bundle/tst_activator.c b/bundles/remote_services/topology_manager/tms_tst/bundle/tst_activator.c index d61c625a..a89142c0 100644 --- a/bundles/remote_services/topology_manager/tms_tst/bundle/tst_activator.c +++ b/bundles/remote_services/topology_manager/tms_tst/bundle/tst_activator.c @@ -23,7 +23,7 @@ #include <service_tracker_customizer.h> #include <service_tracker.h> -#include "bundle_activator.h" +#include "celix_bundle_activator.h" #include "bundle_context.h" #include "service_registration.h" #include "service_reference.h" @@ -99,7 +99,7 @@ static celix_status_t removeImport(void * handle, service_reference_pt reference } -celix_status_t bundleActivator_start(void * userData, celix_bundle_context_t *context) { +celix_status_t celix_bundleActivator_start(void * userData, celix_bundle_context_t *context) { celix_status_t status; struct activator * act = userData; @@ -111,7 +111,7 @@ celix_status_t bundleActivator_start(void * userData, celix_bundle_context_t *co return status; } -celix_status_t bundleActivator_stop(void * userData, celix_bundle_context_t *context) { +celix_status_t celix_bundleActivator_stop(void * userData, celix_bundle_context_t *context) { celix_status_t status; struct activator * act = userData; diff --git a/bundles/remote_services/topology_manager/tms_tst/disc_mock/disc_mock_activator.c b/bundles/remote_services/topology_manager/tms_tst/disc_mock/disc_mock_activator.c index 4fc90539..53929ad1 100644 --- a/bundles/remote_services/topology_manager/tms_tst/disc_mock/disc_mock_activator.c +++ b/bundles/remote_services/topology_manager/tms_tst/disc_mock/disc_mock_activator.c @@ -23,7 +23,7 @@ #include <service_tracker_customizer.h> #include <service_tracker.h> -#include "bundle_activator.h" +#include "celix_bundle_activator.h" #include "bundle_context.h" #include "service_registration.h" #include "service_reference.h" @@ -36,7 +36,7 @@ celix_status_t discovery_endpointAdded(void *handle, endpoint_description_t *endpoint, char *matchedFilter); celix_status_t discovery_endpointRemoved(void *handle, endpoint_description_t *endpoint, char *matchedFilter); -celix_status_t bundleActivator_create(celix_bundle_context_t *context, void **out) { +celix_status_t celix_bundleActivator_create(celix_bundle_context_t *context, void **out) { celix_status_t status = CELIX_SUCCESS; struct disc_mock_activator *act = calloc(1, sizeof(*act)); if (act != NULL) { @@ -58,7 +58,7 @@ celix_status_t bundleActivator_create(celix_bundle_context_t *context, void **ou return CELIX_SUCCESS; } -celix_status_t bundleActivator_start(void * userData, celix_bundle_context_t *context) { +celix_status_t celix_bundleActivator_start(void * userData, celix_bundle_context_t *context) { celix_status_t status; struct disc_mock_activator * act = userData; const char *uuid = NULL; @@ -111,7 +111,7 @@ celix_status_t bundleActivator_start(void * userData, celix_bundle_context_t *co return status; } -celix_status_t bundleActivator_stop(void * userData, celix_bundle_context_t *context) { +celix_status_t celix_bundleActivator_stop(void * userData, celix_bundle_context_t *context) { celix_status_t status; struct disc_mock_activator * act = userData; @@ -121,7 +121,7 @@ celix_status_t bundleActivator_stop(void * userData, celix_bundle_context_t *con return status; } -celix_status_t bundleActivator_destroy(void * userData, celix_bundle_context_t *context) { +celix_status_t celix_bundleActivator_destroy(void * userData, celix_bundle_context_t *context) { struct disc_mock_activator *act = userData; if (act != NULL) { discMockService_destroy(act->serv); diff --git a/bundles/remote_services/topology_manager/tms_tst/disc_mock/disc_mock_service.c b/bundles/remote_services/topology_manager/tms_tst/disc_mock/disc_mock_service.c index e293ac28..047d90b3 100644 --- a/bundles/remote_services/topology_manager/tms_tst/disc_mock/disc_mock_service.c +++ b/bundles/remote_services/topology_manager/tms_tst/disc_mock/disc_mock_service.c @@ -23,7 +23,6 @@ #include <service_tracker_customizer.h> #include <service_tracker.h> -#include "bundle_activator.h" #include "bundle_context.h" #include "service_registration.h" #include "service_reference.h" diff --git a/libs/framework/include_deprecated/bundle_activator.h b/libs/framework/include_deprecated/bundle_activator.h deleted file mode 100644 index 42dc470d..00000000 --- a/libs/framework/include_deprecated/bundle_activator.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -#ifndef BUNDLE_ACTIVATOR_H_ -#define BUNDLE_ACTIVATOR_H_ - -#include <stdlib.h> - -#include "bundle_context.h" -#include "celix_bundle_context.h" -#include "framework_exports.h" -#include "celix_framework_export.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Called when this bundle is started so the bundle can create an instance for its activator. - * The framework does not assume any type for the activator instance, this is implementation specific. - * The activator instance is handle as a void pointer by the framework, the implementation must cast it to the - * implementation specific type. - * - * @param ctx The execution context of the bundle being started. - * @param[out] userData A pointer to the specific activator instance used by this bundle. - * - * @return Status code indication failure or success: - * - CELIX_SUCCESS when no errors are encountered. - * - Any other status code will mark the bundle as stopped and the framework will remove this - * bundle's listeners, unregister all services, and release all services used by this bundle. - */ -CELIX_FRAMEWORK_DEPRECATED_EXPORT celix_status_t bundleActivator_create(celix_bundle_context_t *ctx, void **userData); - -/** - * Called when this bundle is started so the Framework can perform the bundle-specific activities necessary - * to start this bundle. This method can be used to register services or to allocate any resources that this - * bundle needs. - * - * <p> - * This method must complete and return to its caller in a timely manner. - * - * @param userData The activator instance to be used. - * @param ctx The execution context of the bundle being started. - * - * @return Status code indication failure or success: - * - CELIX_SUCCESS when no errors are encountered. - * - Any other status code will mark the bundle as stopped and the framework will remove this - * bundle's listeners, unregister all services, and release all services used by this bundle. - */ -CELIX_FRAMEWORK_DEPRECATED_EXPORT celix_status_t bundleActivator_start(void *userData, celix_bundle_context_t *ctx); - -/** - * Called when this bundle is stopped so the Framework can perform the bundle-specific activities necessary - * to stop the bundle. In general, this method should undo the work that the <code>bundleActivator_start()</code> - * function started. There should be no active threads that were started by this bundle when this bundle returns. - * A stopped bundle must not call any Framework objects. - * - * <p> - * This method must complete and return to its caller in a timely manner. - * - * @param userData The activator instance to be used. - * @param ctx The execution context of the bundle being stopped. - * - * @return Status code indication failure or success: - * - CELIX_SUCCESS when no errors are encountered. - * - Any other status code will mark the bundle as stopped and the framework will remove this - * bundle's listeners, unregister all services, and release all services used by this bundle. - */ -CELIX_FRAMEWORK_DEPRECATED_EXPORT celix_status_t bundleActivator_stop(void *userData, celix_bundle_context_t *ctx); - -/** - * Called when this bundle is stopped so the bundle can destroy the instance of its activator. In general, this - * method should undo the work that the <code>bundleActivator_create()</code> function initialized. - * - * <p> - * This method must complete and return to its caller in a timely manner. - * - * @param userData The activator instance to be used. - * @param ctx The execution context of the bundle being stopped. - * - * @return Status code indication failure or success: - * - CELIX_SUCCESS when no errors are encountered. - * - Any other status code will mark the bundle as stopped and the framework will remove this - * bundle's listeners, unregister all services, and release all services used by this bundle. - */ -CELIX_FRAMEWORK_DEPRECATED_EXPORT celix_status_t -bundleActivator_destroy(void *userData, celix_bundle_context_t* ctx); - -#ifdef __cplusplus -} -#endif - -#endif /* BUNDLE_ACTIVATOR_H_ */ - -/** - * @} - */
