Apache Celix
2.4.0
Apache Celix is a framework for C, C++14 and C++17 to develop dynamic modular software applications using component and in-process service-oriented programming.
|
Go to the documentation of this file.
20 #ifndef CELIX_BUNDLE_ACTIVATOR_H_
21 #define CELIX_BUNDLE_ACTIVATOR_H_
26 #include "celix_dependency_manager.h"
29 #include "celix_constants.h"
31 #if defined(__linux__) || defined(__APPLE__)
33 #define CELIX_BUNDLE_ACTIVATOR_EXPORT __attribute__((visibility("default")))
35 #define CELIX_BUNDLE_ACTIVATOR_EXPORT
138 #define CELIX_GEN_BUNDLE_ACTIVATOR(actType, actStart, actStop) \
140 celix_status_t celix_bundleActivator_create(celix_bundle_context_t *ctx, void **userData) { \
141 celix_status_t status = CELIX_SUCCESS; \
142 void* data = calloc(1, sizeof(actType)); \
143 if (data != NULL) { \
146 status = CELIX_ENOMEM; \
151 celix_status_t celix_bundleActivator_start(void *userData, celix_bundle_context_t *ctx) { \
152 celix_status_t status = CELIX_SUCCESS; \
153 celix_status_t (*fn)(actType*, celix_bundle_context_t*) = (actStart); \
155 status = fn((actType*)userData, ctx); \
160 celix_status_t celix_bundleActivator_stop(void *userData, celix_bundle_context_t *ctx) { \
161 celix_status_t status = CELIX_SUCCESS; \
162 celix_status_t (*fn)(actType*, celix_bundle_context_t*) = (actStop); \
164 status = fn((actType*)userData, ctx); \
166 celix_dependency_manager_t* mng = celix_bundleContext_getDependencyManager(ctx); \
167 celix_dependencyManager_removeAllComponents(mng); \
171 celix_status_t celix_bundleActivator_destroy(void *userData, celix_bundle_context_t *ctx) { \
172 celix_bundleContext_waitForEvents(ctx); \
174 return CELIX_SUCCESS; \
CELIX_BUNDLE_ACTIVATOR_EXPORT celix_status_t celix_bundleActivator_stop(void *userData, celix_bundle_context_t *ctx)
Called when this bundle is stopped so the Framework can perform the bundle-specific activities necess...
#define CELIX_BUNDLE_ACTIVATOR_EXPORT
Definition: celix_bundle_activator.h:35
CELIX_BUNDLE_ACTIVATOR_EXPORT celix_status_t celix_bundleActivator_destroy(void *userData, celix_bundle_context_t *ctx)
Called when this bundle is stopped so the bundle can destroy the instance of its activator.
CELIX_BUNDLE_ACTIVATOR_EXPORT celix_status_t celix_bundleActivator_start(void *userData, celix_bundle_context_t *ctx)
Called when this bundle is started so the Framework can perform the bundle-specific activities necess...
CELIX_BUNDLE_ACTIVATOR_EXPORT celix_status_t celix_bundleActivator_create(celix_bundle_context_t *ctx, void **userData)
Called when this bundle is started so the bundle can create an instance for its activator.