Giter VIP home page Giter VIP logo

apache / celix Goto Github PK

View Code? Open in Web Editor NEW
156.0 30.0 84.0 19.67 MB

Apache Celix is a framework for C and C++14 to develop dynamic modular software applications using component and in-process service-oriented programming.

Home Page: https://celix.apache.org/

License: Apache License 2.0

CMake 6.61% C++ 41.14% C 51.29% HTML 0.02% JavaScript 0.43% Python 0.29% Rust 0.13% Shell 0.08%
cplusplus celix c apache osgi

celix's Introduction

Apache Celix

License Celix Ubuntu Celix MacOS codecov Coverity Scan Build Status Gitpod ready-to-code

Apache Celix is a framework for C and C++14 to develop dynamic modular software applications using component and in-process service-oriented programming. Apache Celix is inspired by the OSGi specification adapted for C and C++.

Documentation

C++ Usage

Hello World Bundle

Modularity in Celix is achieved by runtime installable bundles and dynamic - in process - services.
A Celix bundle is set of resources packed in a zip containing at least a manifest and almost always some shared library containing the bundle functionality. A Celix bundle can be created using the Celix CMake function add_celix_bundle. A Celix bundle is activated by executing the bundle entry points. For C++ bundles these bundle entry points are generated using the CELIX_GEN_CXX_BUNDLE_ACTIVATOR macro.

Celix applications (Celix containers) can be created with the Celix CMake function add_celix_container. This function generates a C++ main function and is also used to configure default installed bundles. This can be bundles provided by Celix, an other project or build by the project self.

//src/MyBundleActivator.cc
#include <iostream>
#include "celix/BundleActivator.h"

class MyBundleActivator {
public:
    explicit MyBundleActivator(const std::shared_ptr<celix::BundleContext>& ctx) {
        std::cout << "Hello world from bundle with id " << ctx->getBundleId() << std::endl;
    }

    ~MyBundleActivator() noexcept {
        std::cout << "Goodbye world" << std::endl;
    }
};

CELIX_GEN_CXX_BUNDLE_ACTIVATOR(MyBundleActivator)
#CMakeLists.txt
find_package(Celix REQUIRED)

add_celix_bundle(MyBundle
    SOURCES src/MyBundleActivator.cc
)

add_celix_container(MyContainer
    BUNDLES
        Celix::ShellCxx
        Celix::shell_tui
        MyBundle
)
#bash
#goto project dir
cd cmake-build-debug #assuming clion cmake-build-debug dir
cd deploy/MyContainer
./MyContainer
#Celix shell
-> lb -a
#list of all installed bundles
-> help
#list of all available Celix shell commands
-> help celix::lb
#Help info about the shell command `celix::lb`
-> stop 3
#stops MyBundle
-> start 3
#starts MyBundle
-> stop 0 
#stops the Celix framework

Register a service

In the Celix framework, a service is a C++ object or C struct registered in the Celix framework service registry under one interface together with properties (meta information). Services can be discovered and used by bundles.

//include/ICalc.h
#pragma once
class ICalc {
public:
    virtual ~ICalc() noexcept = default;
    virtual int add(int a, int b) = 0;
};
//src/CalcProviderBundleActivator.cc
#include "ICalc.h"
#include "celix/BundleActivator.h"

class CalcProvider : public ICalc {
public:
    ~CalcProvider() noexcept override = default;
    int add(int a, int b) override { return a + b; }
};

class CalcProviderBundleActivator {
public:
    explicit CalcProviderBundleActivator(const std::shared_ptr<celix::BundleContext>& ctx) {
        reg = ctx->registerService<ICalc>(std::make_shared<CalcProvider>())
                .build();
    }
private:
    std::shared_ptr<celix::ServiceRegistration> reg{};
};

CELIX_GEN_CXX_BUNDLE_ACTIVATOR(CalcProviderBundleActivator)
#CMakeLists.txt
find_package(Celix REQUIRED)

add_celix_bundle(CalcProviderBundle
    SOURCES src/CalcProviderBundleActivator.cc
)
target_include_directories(CalcProviderBundle PRIVATE include)

add_celix_container(CalcProviderContainer
    BUNDLES
        Celix::ShellCxx
        Celix::shell_tui
        CalcProviderBundle
)
#bash
#goto project dir
cd cmake-build-debug #assuming clion cmake-build-debug dir
cd deploy/CalcProviderBundle
./CalcProviderBundle

Use a service (ad hoc)

//include/ICalc.h
#pragma once
class ICalc {
public:
    virtual ~ICalc() noexcept = default;
    virtual int add(int a, int b) = 0;
};
//src/CalcUserBundleActivator.cc
#include <iostream>
#include "ICalc.h"
#include "celix/BundleActivator.h"

class CalcUserBundleActivator {
public:
    explicit CalcUserBundleActivator(const std::shared_ptr<celix::BundleContext>& ctx) {
        ctx->useService<ICalc>()
            .addUseCallback([](ICalc& calc) {
                std::cout << "result is " << calc.add(2, 3) << std::endl;
            })
            .setTimeout(std::chrono::seconds{1}) //wait for 1 second if a service is not directly found
            .build();
    }
};

CELIX_GEN_CXX_BUNDLE_ACTIVATOR(CalcUserBundleActivator)
#CMakeLists.txt
find_package(Celix REQUIRED)

add_celix_bundle(CalcUserBundle
    SOURCES src/CalcUserBundleActivator.cc
)
target_include_directories(CalcUserBundle PRIVATE include)

add_celix_container(CalcUserContainer
    BUNDLES
        Celix::ShellCxx
        Celix::shell_tui
        CalcProviderBundle
        CalcUserBundle
)
#bash
#goto project dir
cd cmake-build-debug #assuming clion cmake-build-debug dir
cd deploy/CalcUserContainer
./CalcUserContainer

Track services

//include/ICalc.h
#pragma once
class ICalc {
public:
    virtual ~ICalc() noexcept = default;
    virtual int add(int a, int b) = 0;
};
//src/CalcTrackerBundleActivator.cc
#include <mutex>
#include "ICalc.h"
#include "celix/BundleActivator.h"

class CalcTrackerBundleActivator {
public:
    explicit CalcTrackerBundleActivator(const std::shared_ptr<celix::BundleContext>& ctx) {
        tracker = ctx->trackServices<ICalc>()
            .build();
        for (auto& calc : tracker->getServices()) {
            std::cout << "result is " << std::to_string(calc->add(2, 3)) << std::endl;
        }
    }
    
private:
    std::shared_ptr<celix::ServiceTracker<ICalc>> tracker{};
};

CELIX_GEN_CXX_BUNDLE_ACTIVATOR(CalcTrackerBundleActivator)
find_package(Celix REQUIRED)

add_celix_bundle(CalcTrackerBundle
    SOURCES src/CalcTrackerBundleActivator.cc
)
target_include_directories(CalcTrackerBundle PRIVATE include)

add_celix_container(CalcTrackerContainer
    BUNDLES
        Celix::ShellCxx
        Celix::shell_tui
        CalcProviderBundle
        CalcTrackerBundle
)
#bash
#goto project dir
cd cmake-build-debug #assuming clion cmake-build-debug dir
cd deploy/CalcTrackerContainer
./CalcTrackerContainer

Service properties and filters

//src/FilterExampleBundleActivator.cc
#include <iostream>
#include "celix/BundleActivator.h"
#include "celix/IShellCommand.h"

class HelloWorldShellCommand : public celix::IShellCommand {
public:
    void executeCommand(const std::string& /*commandLine*/, const std::vector<std::string>& /*commandArgs*/, FILE* outStream, FILE* /*errorStream*/) {
        fprintf(outStream, "Hello World\n");
    }
};

class FilterExampleBundleActivator {
public:
    explicit FilterExampleBundleActivator(const std::shared_ptr<celix::BundleContext>& ctx) {
        auto reg1 = ctx->registerService<celix::IShellCommand>(std::make_shared<HelloWorldShellCommand>())
                .addProperty(celix::IShellCommand::COMMAND_NAME, "command1")
                .build();
        auto reg2 = ctx->registerService<celix::IShellCommand>(std::make_shared<HelloWorldShellCommand>())
                .addProperty(celix::IShellCommand::COMMAND_NAME, "command2")
                .build();
        regs.push_back(reg1);
        regs.push_back(reg2);
        
        auto serviceIdsNoFilter  = ctx->findServices<celix::IShellCommand>();
        auto serviceIdsWithFilter = ctx->findServices<celix::IShellCommand>(std::string{"("} + celix::IShellCommand::COMMAND_NAME + "=" + "command1)");
        std::cout << "Found " << std::to_string(serviceIdsNoFilter.size()) << " IShelLCommand services and found ";
        std::cout << std::to_string(serviceIdsWithFilter.size()) << " IShellCommand service with name command1" << std::endl;
    }
private:
    std::vector<std::shared_ptr<celix::ServiceRegistration>> regs{};
};

CELIX_GEN_CXX_BUNDLE_ACTIVATOR(FilterExampleBundleActivator)
#CMakeLists.txt
find_package(Celix REQUIRED)

add_celix_bundle(FilterExampleBundle
    SOURCES src/FilterExampleBundleActivator.cc
)
target_link_libraries(FilterExampleBundle PRIVATE Celix::shell_api) #adds celix/IShellCommand.h to the include path

add_celix_container(FilterExampleContainer
    BUNDLES
        Celix::ShellCxx
        Celix::shell_tui
        FilterExampleBundle
)
#bash
#goto project dir
cd cmake-build-debug #assuming clion cmake-build-debug dir
cd deploy/FilterExampleContainer
./FilterExampleContainer
#Celix shell
-> command1
-> command2
-> help

celix's People

Contributors

abroekhuis avatar bakkerv avatar bpetri avatar dhbfischer avatar ealanrian avatar erjanaltena avatar fredster33 avatar gabrielericciardi avatar idzardh avatar jermus67 avatar michielbouwhuis avatar noek1993 avatar oipo avatar pengzheng avatar pnoltes avatar rbulter avatar rlenferink avatar schorg avatar stegemr avatar tira-misu avatar troepje avatar unitink72 avatar wanglzh avatar was1840 avatar webmastertd avatar xuzhenbao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

celix's Issues

RSA replyStatus is independent of HTTP return code

remoteServiceAdmin_send does have a out-param replyStatus, which indicates whether the curl request was executed without error. In addition remoteServiceAdmin_send returns a CELIX_ILLEGAL_STAE in case curl_easy_init failed.

There is no indication for the caller, whether a Server or Client Error occured!

My proposal would be to

  • return a CELIX_ILLEGAL_STATE when the curl_easy_perform returns an error (e.g. UNSUPPORTED PROTOCOL)
  • return the http code in the replyState (be aware that the replyState would be set to 200 in case of success)

Original creation date: 26/Jun/2015
Reporter: @bpetri

Support code sharing

Celix currently doesn't support code sharing. To make it easier to use data types it makes sense to support this. Currently it is needed to add service functions for all data types provided by a component.

To support code sharing on a OSGi level it is needed to:

  • Declare exported and imported libraries
  • Use a resolver to find/match exported libraries
  • Resolve bundles when needed
  • Update CMake macros to support this

With CELIX-111 solving multi library support, most of the work will already be in place.
Exported and imported libraries can be defined in the manifest using "Export-Library" and "Import-Library".
One of the major benefits of OSGi is versioning, to be able to reuse those principles in Celix the imported and exported libraries need to define versions/ranges. The format of the import and export string can be taken from the OSGi specification:

  • Import-Library: first;version="[1.0,2.0)",second;version=...
  • Export-Library: first;version="1.0",second;version=...

With the metadata available in the manifest, the existing (but unused) resolver can be updated to use that information. The output of the resolver can be used to load needed libraries. This will result in a fairly big change, currently the library of a bundle is loaded when the bundle is started, not when it is resolved. Since with the resolver it is possible for a bundle to be resolved and not yet started, libraries should be loaded when a bundle is resolved. This is needed to be able to use libraries of resolved bundles.

Also, the framework marks a bundle resolved if it is being processed by the resolver, so not all bundle enter the resolved state as part of the startBundle function. Currently libraries are loaded in the startBundle function, this has to be moved to a separate function which can be used by the resolver as well.
Note: The resolver itself is independent from the framework, so marking bundles resolved is done by the framework, but NOT always from the startBundle function. See the framework_markBundleResolved function for the implementation. This function can be used to load the libraries.

Regarding versioning:
The existing resolver supports resolving version ranges (it was ported from Felix when Celix started). But there is one big problem regarding libraries and versioning, when a library is linked to another library, the name of that library is added to the table of the first library. To be able to support multiple versions of a library the name of the library must have a version in it, eg libtest-1.0.0.dylib etc, so the name in the entry also contains the explicit version.
When in the runtime system a slightly newer version, eg 1.0.1, is available, the resolver will accept this if the importer range says so, import-library: test;version="[1.0,2.0)". Accepting this will result in the libraries being loading, which will result in a failure because the library has an entry for 1.0.0 and not 1.0.1.
This is explained in more detail in the Native-OSGi RFC, and a possible solution is to update the library entry with the information found by the resolver.

Since this requires a lot more work for now Celix will only support fixed version dependencies.
Note: Should we solve this in code, or leave this a convention and keep version range support intact the way it is? Leaving it intact makes it easier to add the library updating without any additional work.


Original creation date: 04/Mar/2014
Reporter: @abroekhuis

Refactor event admin

The event admin currently does not work anymore. Refactor the event admin so that it works again and that:

  • It created and export a event_admin_api interface library target containing the api
  • Update api so that for event admin no event struct is needed -> i.e. signature celix_status_t (postEvent)(event_admin_t *event_admin, const char *topic, propeties_t *props);
  • event admin api only contains a sendEvent and postEvent method.
  • For sendEvent and postEvent the caller is responsbile for freeing the properties
  • For postEvent the event admin will create a copy of the properties
  • The eventHandle api contains one method with the signature: celix_status_t (*handleEvent)(void *handle, const char *topic, const properties_t *props);
  • For event handler the topic and properties arguments are only ensure to be valid during the executing of the handleEvent method.

Original creation date: 09/Apr/2018
Reporter: @pnoltes

Bundles throwing an exception during the bundleActivator_create cannot stop

When a bundle returns an exception during the bundleActivator_create call, the state of the bundle is 'Starting' instead of 'Resolved'. Because the state of the bundle is 'Starting' the bundle cannot be stopped (see attachment).

This can be reproduced by returning a CELIX_*_EXCEPTION in the bundleActivator_create function.

celix bundle exception


Original creation date: 24/Jan/2017
Reporter: @rlenferink

Installable celix container

Add support to install celix container with a install_celix_container command.

The install command should ensure that the celix container does not depend on a workdir location.

This means a solution is needed for the work dir created .cache dir and a how to specify bundles without using absolute paths.

A possible solution is to create a "fat" executable containing the bundles inside the binary.


Original creation date: 09/Apr/2019
Reporter: @pnoltes

discovery_shm does not support same-named services

The current implementation of the discovery_shm bundle is using only the servicename to announce/discover exported services. This is quite unfavorable as it does not allow to have the same name exported by several Celix instances.


Original creation date: 09/Jun/2014
Reporter: @bpetri

celix build for raspberry pi2 fails

Building celix for raspberry pi2 with yocto poky distro version 2.2
gives warning: "readdir_r is deprecated"
and since all warnings are treated as errors the build fails.
(See log.do_compile.4948)
The following changes were needed for succesful compilation

./celix/CMakeLists.txt
39,40c39
< # SET(CMAKE_C_FLAGS "-D_GNU_SOURCE -std=gnu99 -Wall -Werror -fPIC ${CMAKE_C_FLAGS}")
< SET(CMAKE_C_FLAGS "-D_GNU_SOURCE -std=gnu99 -Wall -fPIC ${CMAKE_C_FLAGS}")

./celix/dependency_manager_cxx/CMakeLists.txt
22,23c22
< # set(CMAKE_CXX_FLAGS "-Wall -Werror -fno-rtti -fno-exceptions ${CMAKE_CXX_FLAGS}")
< set(CMAKE_CXX_FLAGS "-Wall -fno-rtti -fno-exceptions ${CMAKE_CXX_FLAGS}")

./celix/examples/dm_example_cxx/CMakeLists.txt
19,20c19
< # set(CMAKE_CXX_FLAGS "-Wall -Werror -fno-rtti -fno-exceptions ${CMAKE_CXX_FLAGS}")
< set(CMAKE_CXX_FLAGS "-Wall -fno-rtti -fno-exceptions ${CMAKE_CXX_FLAGS}")

./celix/examples/services_example_cxx/CMakeLists.txt
19,20c19
< # set(CMAKE_CXX_FLAGS "-Wall -Werror -fno-rtti -fno-exceptions ${CMAKE_CXX_FLAGS}")
< set(CMAKE_CXX_FLAGS "-Wall -fno-rtti -fno-exceptions ${CMAKE_CXX_FLAGS}")

Also the link stage fails with the error:
../../framework/libcelix_framework.so.2: undefined reference to dlsym' ../../framework/libcelix_framework.so.2: undefined reference to dlerror'
../../framework/libcelix_framework.so.2: undefined reference to dlopen' ../../framework/libcelix_framework.so.2: undefined reference to dlclose'
(See log.do_compile.4948)

I had to add the dl library to the link libraries to make the build work:

./celix/deployment_admin/CMakeLists.txt
64c64
< target_link_libraries(deployment_admin celix_framework ${CURL_LIBRARIES} dl)

./celix/launcher/CMakeLists.txt
29c29
< target_link_libraries(celix celix_framework ${CURL_LIBRARIES} dl)
31c31
< target_link_libraries(celix celix_dfi dl) #note not strictly needed, but ensure libdfi is a dep for the framework, useful when create docker images

./celix/utils/CMakeLists.txt
61c61
< target_link_libraries(celix_utils m pthread dl)

The bitbake do_package_qa stage fails with:
ERROR: QA Issue: celix: /work/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/celix/1.0-r0/packages-split/celix/usr/bin/celix contains probably-redundant RPATH /usr/lib [useless-rpaths]
(See log.do_package_qa.10608)
I solved this by adding the following in the celix.bb file:
INSANE_SKIP_${PN} += "useless-rpaths"

With these changes celix builds and i can run the hello world and dm examples on the pi2.

log.do_compile.4948
log.do_package_qa.10608


Original creation date: 16/Dec/2016
Reporter: Rob

Memory used by libxml2 not released at program close

There are a few memory leaks reported by valgrind for libxml2. These can probably be fixed by calling xmlCleanupParser() after the bundles which use libxml2 are done, but before the libxml2 library is unloaded.


Original creation date: 11/Feb/15
Reporter: Daniel Parker

Refactor cache dir behaviour

Currently the celix .cache dir is default created in the workdir and not cleanup during shutdown. To make celix act more like a normal program this should be refactored.

Move the default location of the cache file to (e.g.) /tmp/celix/cache-XXXXXXX (using mktemp) and default cleanup the .cache during shutdown.

Ensure that the cache behavior is configurable to that user can opt-in to the previous behavior.


Original creation date: 09/Apr/2018
Reporter: @pnoltes

Update documentation for 2.3.0 release

This includes:

  • documents/intro
  • documents/building/README.md
  • documents/getting_started/README.md
  • documents/subprojects (specifically C/C Dependency Manager for the update API and bundle gen macros)
  • missing shell wui
  • missing http admin
  • missing pubsub
  • getting_started/using_services_with_c.md (use CELIX_GEN_BUNDLE_ACTIVATOR macros)
  • Also needs verification if all the steps in the getting started guide still works

Race condition in adding/removing service listener hooks

There is a race condition when removing or adding service listener hooks. This is because the underlining service registration of the service listener hook service is not protected while using it.

Adding a usage count with condition should fix this.

Add support to declare link libraries needed for containers for bundles

Some bundles required that the container (executable) is linked against certain libraries (e.g. libjanson, libcurl, etc). To make this process more transparent add a CMake command to declare this and update the add_celix_container functionality to take this into account.

Somethink link celix_bundle_add_container_libraries


Original creation date: 09/Apr/2018
Reporter: @pnoltes

Bundle Manifest unused

After some confusion during a debug session, i looked into why the "bundle->manifest" pointer was always NULL. It turns out this is initialized at creation, then never assigned. Yet the framework works fine? Apparently the manifest files distributed in each bundle ARE used, by the bundle revision. Each bundle revision holds a manifest, that is then used for module creation and data acquisition.

The question then remains, is this construct correct? in which case I would propose to delete the "bundle->manifest" field, since it causes confusion (and Celix could do with a bit less confusion).


Original creation date: 26/Jan/2016
Reporter: Menno van der Graaf

Refactor CppUTest tests to gtest

Currently CppUTest is used for testing and mocking and although this framework works fine, I would be handier to move to gtest( google test) for a few reasons:

  1. more easier to integrate as a external project
  2. much more heavily used than CppUTest
  3. integrated support in the CLion IDE. This means that the IDE supports directly running/debugging individually testcases/testsuites.

This would also mean that the cpputest mocks should be removed. This can be done as long as we keep the code coverage as good as intact.


Original creation date: 06/May/2018
Reporter: @pnoltes

data race in rsa export tests leads to spurious fails

when running the rsa export tests, there is no chance for the client side to drop the imported endpoints between two tests:

  • Server runs stop/start cycle 1, exporting endpoint/services A
  • Client imports endpoints and according services A, runs test
  • Server runs stop/start cycle 2, exporting endpoint/services B
  • Client runs test but still picks up A, although it should wait for the import of b, because there was no time yet to remove them. With the next discovery poll of the client the endpoint is removed and the belonging service invalidated -> the test fails.

Original creation date: 02/Dec/2015
Reporter: @bpetri

Suppress warning for ENDPOINT_DESCRIPTOR_READER

the warning message "WARNING: ENDPOINT_DESCRIPTOR_READER: Only single-valued string supported for service.id" is output a lot in the shell. This causes any output you wanted to see to scroll away. It would be nice if there was a way to stop that.


Original creation date: 17/Nov/2014
Reporter: Mark Butsch

Add a IPC message queue PubSubAdmin and maybe discovery

For local communication and testing purposes it would be nice to have a PubSubAdmin based on the POSIX IPC message queues system. If feasible discovery based on POSIC IPC messages queues would also be nice, but a fallback to use shared memory is maybe more logical for discovery (see also the shared memory based remote service discovery)

A primary goal should be that this PubSub setup should work out of the box with no configuration (as long as the processes are on the same host)


Original creation date: 31/Jan/2018
Reporter: @pnoltes

version and version_range mocks outdated and still used

Some of the framework tests still use the "version" and/or "version_range" mock.
with the transition of CELIX-323, the version and "version_range" to the utils, the mock remained in the framework mocks.
After/during the move, new functionality was added to the source files, the mocks are now out of date.
Since almost every test links against the celix_utils lib, the mock is also redundant.

either the mocks need to be kept up to date and moved to the utils, or they should be removed, which will require some of the tests to be adapted.

the framework tests in question are:

  • bundle_test
  • capability_test
  • manifest_parser_test
  • module_test
  • requirement_test
  • resolver_test
  • they might each require different amounts of adaptation

Original creation date: 07/Jan/2016
Reporter: Menno van der Graaf

remote_service_admin_shm does not support same-named services

The remote_service_admin_shm uses default-keys to set up shared memory communication between an endpoint and a proxy. And although this could be overwritten by setting according configuration properties (in the exported service), this solution will not work if the same service is exported by several Celix frameworks.


Original creation date: 09/Jun/2014
Reporter: @bpetri

Remote shell crashes during shutdown

The remoteShell crashes when stopped because it gets used after it is already destroyed.

ogram received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffecae3700 (LWP 20314)]
0x00007fffed2e8a65 in logHelper_log (loghelper=0x0, level=OSGI_LOGSERVICE_INFO, 
    message=0x7fffed2e8be0 "CONNECTION_LISTENER: Stopping thread\n")
    at /home/bjoern/Development/inaetics/update.Provisioning/celix/celix/log_service/public/src/log_helper.c:185
185	    if (!logged && loghelper->stdOutFallback) {
(gdb) 
(gdb) bt 
#0  0x00007fffed2e8a65 in logHelper_log (loghelper=0x0, level=OSGI_LOGSERVICE_INFO, 
    message=0x7fffed2e8be0 "CONNECTION_LISTENER: Stopping thread\n")
    at /home/bjoern/Development/inaetics/update.Provisioning/celix/celix/log_service/public/src/log_helper.c:185
#1  0x00007fffed2e728b in connectionListener_stop (instance=0x60f160)
    at /home/bjoern/Development/inaetics/update.Provisioning/celix/celix/remote_shell/private/src/connection_listener.c:100
#2  0x00007fffed2e6f6f in bundleActivator_stop (userData=0x60d3d0, context=0x60e1b0)
    at /home/bjoern/Development/inaetics/update.Provisioning/celix/celix/remote_shell/private/src/activator.c:106
#3  0x00007ffff7bbcdb4 in fw_stopBundle (framework=0x604060, bundle=0x619490, record=false)
    at /home/bjoern/Development/inaetics/update.Provisioning/celix/celix/framework/private/src/framework.c:898
#4  0x00007ffff7bc01a1 in framework_shutdown (framework=0x604060)
    at /home/bjoern/Development/inaetics/update.Provisioning/celix/celix/framework/private/src/framework.c:2063
#5  0x00007ffff5d12182 in start_thread (arg=0x7fffecae3700) at pthread_create.c:312
#6  0x00007ffff747147d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Original creation date: 27/Jun/2015
Reporter: @bpetri

Add support for dynamic loaded shared libraries bundles

Add support for shared library (e.g. so / dylib files) as bundles.

Note that these bundles should be resolvable on their own and cannot have additional shared libraries dependencies, as is the case for zip bundles.

Shared library bundle still should have bundle activator symbols, but should also contain an embedded zip resource (using objcopy to attach a (zip) resource file to the shared object, which can be retrieved using predefined symbols)

Advantages is that these bundles can still be used as normal shared objects (also in CMake) and make it easier to load the symbols for bundles to gdb.


Original creation date: 31/Jan/2018
Reporter: @pnoltes

Make it possible to configure bundle dirs

Currently bundles specified in the cosgi.auto.start.1 config property should be a) absolute path or relative paths from the work dir.

Extend the framework so that multiple bundle dirs can be specified to search for existing bundles using a config property. If this property is not set, the result should be that there is a single bundle dir configured to the work dir. Multiple dirs can be specified using using colons.

Proposed config property:
CELIX_BUNDLE_DIRS


Original creation date: 09/Jan/2018
Reporter: @pnoltes

Add doxygen generation for celix

Specifically for the following headers:

  • celix_api.h
  • celix_bundle_context.h
  • celix_bundle.h
  • celix_bundle_activator.h
  • celix_framework.h
  • celix_framework_header.h
  • celix_dm_*.h
  • (TODO) celix_constants.h

The rest of the headers are not needed nor wanted, because we want to promote the use of celix_ prefixed api. Eventual all not celix_ prefixed api will be deprecated and removed.

The generated result should be added to the Celix website.

Make bundle_archive.h/revision.h and module.h headers private

To reduce the number of visible headers and the resulting complexity of that make the bundle_archive.h, bundle_revision.h and module.h private headers.

Functionality missing should have been added to the bundle.h in issue CELIX-439.


Original creation date: 10/Apr/2018
Reporter: @pnoltes

Signed zip files

Background:
Apache Celix (incubator) is an implementation of the OSGi specification adapted to C. It will follow the API as close as possible, but since the OSGi specification is written primarily for Java, there will be differences (Java is OO, C is procedural). An important aspect of the implementation is interoperability between Java and C. This interoperability is achieved by porting and implementing the Remote Services specification in Celix.

Proposal:
Implement the Digital Signed Jar Files part of the core OSGI (4.3) specification for Apache Celix adapted to C.
Part of the core OSGi specification describes how to handle signed jar files, so that authentication of the signer is possible and ensure that the bundle has not been tampered.
For Apache Celix we like to see a similar solution, but then adapted for C (So for example Zips instead of Jars).

Needed knowledge:
C, Java & OSGi


Original creation date: 28/Mar/2013
Reporter: @pnoltes

Create celix_constants.h to replace constants.h

Most of the celix user API got a celix_ prefixed alternative. This is not jet the case fo the constants.h. This is needed, because a header name constants.h can easily lead to clashed.

Note this needs to be done correctly ->All the celix_*.h headers depending on celix constants need to include celix_constants.h and not constants.h (i.e. move all contants to celix_constants.h and include that from constants. Also when needed add a CELIX_ prefix to the constants in the celix_contants.h)

Add support for symbol based serialization/RPC

Currently the remote service admin and pubsub are based on the use of dfi and descriptors. Another option could be to support the de/serialization and RPC using predefined function signatures.

Using the extender pattern these function can be found and used without polluting the types/services with serialization/RPC code and make it possible to support a wide range of existing serialization/rpc techniques.

For example a service with the name "HelloWord" could have a bundle entry 'META-INF/services/HelloWorld.rpc_info' entry containing a simple properties files with - atleast- the entires "create_proxy" and "create_endpoint". These refer to symbols in the shared libraries of the bundle with predefined signatures.

More design details are needed before this can be implemented. Also a initial tech. should be chosen (e.g. RPC).


Original creation date: 09/Apr/2018
Reporter: @pnoltes

RSA 1.1 - add support for EndpointEventListener

RSA 1.1 introduces EndpointEventListener and deprecates the EndpointListener. To make Celix interoperable with a RSA 1.1 implementation, this EndpointEventListener interface should be supported...


Original creation date: 25/Jul/2014
Reporter: J.W. Janssen

Refactor shared memory remote service admin to use dfi

Currently the shared memory remote service admin is disable and not correctly building.

These issues can be fixed, but because the shared memory rsa is using proxy/endpoint bundles it better to first refactor it to use the dfi lib.


Original creation date: 09/Apr/2018
Reporter: @pnoltes

Add support for static/linked libraries bundles

Support for Static Bundle Libraries

The goal of this ticket is to introduce support for static bundle libraries in Apache Celix. These static libraries, which may or may not include shared libraries, will be linked with an executable and function as bundles for the Apache Celix Framework.

Advantages

  • Simplified Deployment: By allowing the creation of single executable files that can encompass all necessary dependencies, the deployment process can become more straightforward.

  • Less Configuration: Leveraging static libraries reduces the need for additional configuration (bundles dependencies, compiler defines for bundle files, etc), particularly during testing. It could be possible that only a linking to a (static) bundle library is needed.

  • Standard Build Tool Usage: Bundles as static libraries can use the default build tooling facilities (linking, installation, and other build-related tasks).

  • Rust alignment: Using static libraries as bundle is more aligned with development concept used in languages like Rust.

Challenges

  • Maintaining the Open-Close Principle: A challenge is ensuring that static bundle libraries can be integrated without violating the Open-Close Principle. Ideally, developers should be able to include static bundle libraries with minimal changes to the source code. One potential solution to explore is using the compiler attribute __attribute__((constructor)) to handle initialization.

  • Handling Resource Files: Static bundle libraries should be capable of containing resource files. A possible approach to address this is by "linking" binary zip files into the static bundle library. This method allows resource files to be embedded within the bundle.

  • Multiple Framework Instances: If the concept of __attribute__((constructor)) is adopted, this will have impact when multiple framework instances are created. Bundles could be added to all instances by default or only the first instance, etc.

  • Bundle Activator Setup: The current setup for bundle activators relies on predefined symbol names, which does not function with static bundles. Although not a major issue, it could complicate the creation of two versions of a bundle, one as a static bundle and the other as a zip bundle.

  • Default Delivered Bundle: A final decision must be made regarding the default delivered bundle type for Apache Celix bundles (static bundle, zip bundle or both)

Links

https://docs.cppmicroservices.org/en/stable/framework/doc/static_bundles.html

Update Apache Celix website

Update the Apache Celix website look & feel, content en usage of CMS to make it more accessible and maintainable.

RSA crashes on travis

This seems to always happen for OSX and sometimes for Linux.

I could not reproduce on my system. OSX 10.14.6


Original creation date: 10/Sep/2019
Reporter: @pnoltes

Coverage result for PSA UDPMC not working

The coverage result for the PSA UDPMC is not working.

Seems like the gcda files are not generated. Curiously the PSA ZMQ coverage is working and the setup seems te same ...


Original creation date: 07/Jan/2019
Reporter: @pnoltes

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.