This is an automated email from the ASF dual-hosted git repository. pnoltes pushed a commit to branch feature/585-celix-conditions in repository https://gitbox.apache.org/repos/asf/celix.git
commit 5cc100dc26c50e199ba25110632809e57e667e10 Author: Pepijn Noltes <[email protected]> AuthorDate: Tue Jul 11 23:30:39 2023 +0200 Fix some minor documentation / comments --- documents/framework.md | 3 +++ libs/framework/gtest/src/FrameworkBundleTestSuite.cc | 6 +++--- libs/framework/include/celix/FrameworkFactory.h | 2 +- libs/framework/include/celix_condition.h | 10 +++------- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/documents/framework.md b/documents/framework.md index 91d9dbb4..c773335c 100644 --- a/documents/framework.md +++ b/documents/framework.md @@ -227,6 +227,9 @@ The Apache Celix framework will provide the following `celix_condition` services - Celix condition "framework.error". This service will be registered when the framework has not started successfully. This can occur if any of the configured bundles fail to start or install. Note that the "framework.error" condition is not part of the OSGi condition specification. +- Celix condition "components.ready". This service will be registered when the "framework.ready" or "framework.error" + service is registered, all components have become active and the event queue is empty. + Note that the "components.ready" condition is not part of the OSGi condition specification. Contrary to the OSGi specification, the Apache Celix framework does not provide a public API for adding or removing framework listeners. Instead, framework condition services can be used. This has the advantage of ensuring no diff --git a/libs/framework/gtest/src/FrameworkBundleTestSuite.cc b/libs/framework/gtest/src/FrameworkBundleTestSuite.cc index bd5d6985..c3067efa 100644 --- a/libs/framework/gtest/src/FrameworkBundleTestSuite.cc +++ b/libs/framework/gtest/src/FrameworkBundleTestSuite.cc @@ -124,13 +124,13 @@ TEST_F(FrameworkBundleTestSuite, FrameworkReadyRegisteredLaterTest) { EXPECT_EQ(1, count); // And the service.id of the framework.ready condition is higher than the service.id of the test condition - //(white-box test, framework.ready condition is registered last) + //(white-box test, framework.ready condition is registered later) long readySvcId = ctx->findServiceWithName(CELIX_CONDITION_SERVICE_NAME, frameworkReadyFilter); long testySvcId = ctx->findServiceWithName(CELIX_CONDITION_SERVICE_NAME, testFilter); EXPECT_GT(readySvcId, testySvcId); - // And the "components.ready" condition is not available, because the test bundle contains a component which will - // not become active + // And the "components.ready" condition does not become available, because the test bundle contains a component + // which will not become active count = ctx->useService<celix_condition>(CELIX_CONDITION_SERVICE_NAME) .setFilter(componentsReadyFilter) .setTimeout(std::chrono::milliseconds{USE_SERVICE_TIMEOUT_IN_MS}) diff --git a/libs/framework/include/celix/FrameworkFactory.h b/libs/framework/include/celix/FrameworkFactory.h index 4872a8b0..520a2c56 100644 --- a/libs/framework/include/celix/FrameworkFactory.h +++ b/libs/framework/include/celix/FrameworkFactory.h @@ -49,4 +49,4 @@ inline std::shared_ptr<celix::Framework> createFramework(const celix::Properties celix_frameworkFactory_destroyFramework(cFw); }}; } -} // namespace celix \ No newline at end of file +} // namespace celix diff --git a/libs/framework/include/celix_condition.h b/libs/framework/include/celix_condition.h index f901e61c..bd86b4ba 100644 --- a/libs/framework/include/celix_condition.h +++ b/libs/framework/include/celix_condition.h @@ -44,16 +44,12 @@ extern "C" { * @brief Celix condition service struct. * * In dynamic systems, such as OSGi and Apache Celix, one of the more challenging problems can be to define when - * a system or part of it is ready to do work. The answer can change depending on the individual perspective. - * The developer of a web server might say, the system is ready when the server starts listening on port 80. - * An application developer however would define the system as ready when the database connection is up and all - * servlets are registered. Taking the application developers view, the web server should start listening on - * port 80 when the application is ready and not beforehand. + * a system or part of it is ready to do work. * - * The Condition service interface is a marker interface designed to address this issue. + * The celix_condition service interface is a marker interface designed to address this issue. * Its role is to provide a dependency that can be tracked. It acts as a defined signal to other services. * - * A Condition service must be registered with the "celix.condition.id" service property. + * A celix_condition service must be registered with the "condition.id" service property. */ typedef struct celix_condition { void* handle; /**< private dummy handle, note not used in marker service struct, but added to ensure
