Celix  2.2.0
An implementation of the OSGi specification adapted to C and C++
Functions
celix_framework.h File Reference
#include "celix_types.h"
#include "celix_properties.h"
Include dependency graph for celix_framework.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

const char * celix_framework_getUUID (const celix_framework_t *fw)
 
celix_bundle_context_t * celix_framework_getFrameworkContext (const celix_framework_t *fw)
 
celix_bundle_t * celix_framework_getFrameworkBundle (const celix_framework_t *fw)
 
void celix_framework_useBundles (celix_framework_t *fw, bool includeFrameworkBundle, void *callbackHandle, void(*use)(void *handle, const celix_bundle_t *bnd))
 
bool celix_framework_useBundle (celix_framework_t *fw, bool onlyActive, long bndId, void *callbackHandle, void(*use)(void *handle, const celix_bundle_t *bnd))
 

Function Documentation

celix_bundle_t* celix_framework_getFrameworkBundle ( const celix_framework_t *  fw)

Returns the framework bundle. This is the same as a 'normal' bundle, expect that this bundle cannot be uninstalled and the celix_bundle_getEntry return a entries relative from the working directory.

Parameters
fwThe framework
Returns
A pointer to the bundle of the framework or NULL if something went wrong.
celix_bundle_context_t* celix_framework_getFrameworkContext ( const celix_framework_t *  fw)

Returns the framework bundle context. This is the same as a 'normal' bundle context and can be used to register, use and track services. The only difference is that the framework is the bundle.

Parameters
fwThe framework
Returns
A pointer to the bundle context of the framework or NULL if something went wrong.
const char* celix_framework_getUUID ( const celix_framework_t *  fw)

Returns the framework UUID. This is unique for every created framework and will not be the same if the process is restarted.

bool celix_framework_useBundle ( celix_framework_t *  fw,
bool  onlyActive,
long  bndId,
void *  callbackHandle,
void(*)(void *handle, const celix_bundle_t *bnd)  use 
)

Use the bundle with the provided bundle id The provided callback will be called if the bundle is found.

Parameters
fwThe framework.
onlyActiveIf true only starting and active bundles will trigger the callback.
bundleIdThe bundle id.
callbackHandleThe data pointer, which will be used in the callbacks
useThe callback which will be called for the currently started bundles. The bundle pointers are only guaranteed to be valid during the callback.
Returns
Returns true if the bundle is found and the callback is called.
void celix_framework_useBundles ( celix_framework_t *  fw,
bool  includeFrameworkBundle,
void *  callbackHandle,
void(*)(void *handle, const celix_bundle_t *bnd)  use 
)

Use the currently active (started) bundles. The provided callback will be called for all the currently started bundles.

Parameters
ctxThe bundle context.
includeFrameworkBundleIf true the callback will also be triggered for the framework bundle.
callbackHandleThe data pointer, which will be used in the callbacks
useThe callback which will be called for the currently started bundles. The bundle pointers are only guaranteed to be valid during the callback.