Apache Celix
2.3.0
An implementation of the OSGi specification adapted to C and C++
|
Go to the documentation of this file.
23 #include "celix_dependency_manager.h"
25 #ifndef CELIX_BUNDLE_ACTIVATOR_H_
26 #define CELIX_BUNDLE_ACTIVATOR_H_
128 #define CELIX_GEN_BUNDLE_ACTIVATOR(actType, actStart, actStop) \
130 celix_status_t celix_bundleActivator_create(celix_bundle_context_t *ctx, void **userData) { \
131 celix_status_t status = CELIX_SUCCESS; \
132 void* data = calloc(1, sizeof(actType)); \
133 if (data != NULL) { \
136 status = CELIX_ENOMEM; \
141 celix_status_t celix_bundleActivator_start(void *userData, celix_bundle_context_t *ctx) { \
142 celix_status_t status = CELIX_SUCCESS; \
143 celix_status_t (*fn)(actType*, celix_bundle_context_t*) = (actStart); \
145 status = fn((actType*)userData, ctx); \
150 celix_status_t celix_bundleActivator_stop(void *userData, celix_bundle_context_t *ctx) { \
151 celix_status_t status = CELIX_SUCCESS; \
152 celix_status_t (*fn)(actType*, celix_bundle_context_t*) = (actStop); \
154 status = fn((actType*)userData, ctx); \
156 celix_dependency_manager_t* mng = celix_bundleContext_getDependencyManager(ctx); \
157 celix_dependencyManager_removeAllComponents(mng); \
161 celix_status_t celix_bundleActivator_destroy(void *userData, celix_bundle_context_t *ctx) { \
162 celix_bundleContext_waitForEvents(ctx); \
164 return CELIX_SUCCESS; \
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...
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.
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_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.