Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apache Celix Features #623

Open
pnoltes opened this issue Aug 24, 2023 · 0 comments
Open

Apache Celix Features #623

pnoltes opened this issue Aug 24, 2023 · 0 comments
Labels
build/cmake Categorizes an issue or PR relevant to the cmake build. kind/feature Categorizes issue or PR as related to a new feature.

Comments

@pnoltes
Copy link
Contributor

pnoltes commented Aug 24, 2023

Apache Celix Features

Add support for Apache Celix Features, inspired by Apache Karaf Features. This will allow users to select bundles and link the required libraries for the executable/container using a single entity.

Background

Apache Karaf has a concept of "feature" to make it easier to add a selection of bundles.

Apache Karaf provides a simple and flexible way to provision applications.
In Apache Karaf, the application provisioning is an Apache Karaf "feature".
A feature describes an application as:

  • a name
  • a version
  • a optional description (eventually with a long description)
  • a set of bundles
  • optionally a set configurations or configuration files
  • optionally a set of dependency features

Proposed Solution

For Apache Celix, introducing a feature concept would be beneficial, especially for specifying additional linking requirements for the executable/container running the feature-based selected bundles. This is because some bundles depend on system-installed libraries rather than private bundle libraries.

Take the civetweb::civetweb library, for instance. Linking to this library is necessary if an executable/container uses the http_admin:

    #examples/celix-examples/http_example/CMakeLists.txt 
    ...
    target_link_libraries(http_example PRIVATE Celix::http_admin_api)
    ...

With the Apache Celix Features concept, this could be arranged by the feature if it supports library configuration. A feature could then be defined in CMake as:

add_celix_feature(celix_http_admin
   NAME "Apache Celix HTTP Admin"
   DESCRIPTION "Adds the Apache Celix HTTP Admin bundle so that the HTTP whiteboard pattern can be used to pick up HTTP and/or websocket services."
   VERSION "1.0.0"
   BUNDLES_LEVEL_3 Celix::http_admin
   EXE_LINKING Celix::http_admin_api

Usage might look like:

add_celix_container(my_container 
  FEATURES celix_http_admin
)
# or 
# celix_container_features(my_container celix_http_admin)

Downsides

  • The proposed solution relies on CMake, which further tightens the coupling between Apache Celix and CMake.
  • The add_celix_feature calls should either be "installable" or provided in the CelixConfig.cmake (or a Use.cmake file) to ensure they are usable downstream.
@pnoltes pnoltes added kind/feature Categorizes issue or PR as related to a new feature. build/cmake Categorizes an issue or PR relevant to the cmake build. labels Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build/cmake Categorizes an issue or PR relevant to the cmake build. kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

1 participant