Apache Celix  2.3.0
An implementation of the OSGi specification adapted to C and C++
Classes | Typedefs | Functions
celix_bundle.h File Reference
#include "celix_types.h"
#include "bundle_state.h"
#include "celix_properties.h"
#include "celix_array_list.h"
Include dependency graph for celix_bundle.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  celix_bundle_service_list_entry
 
struct  celix_bundle_service_tracker_list_entry
 

Typedefs

typedef struct celix_bundle_service_list_entry celix_bundle_service_list_entry_t
 
typedef struct celix_bundle_service_tracker_list_entry celix_bundle_service_tracker_list_entry_t
 

Functions

long celix_bundle_getId (const celix_bundle_t *bnd)
 Returns the bundle id. More...
 
celix_bundle_state_e celix_bundle_getState (const celix_bundle_t *bnd)
 Returns the bundle state. More...
 
char * celix_bundle_getEntry (const celix_bundle_t *bnd, const char *path)
 
const char * celix_bundle_getManifestValue (const celix_bundle_t *bnd, const char *attribute)
 Get a manifest attribute value from the bundle manifest. More...
 
const char * celix_bundle_getGroup (const celix_bundle_t *bnd)
 Returns the group of the bundle. Groups are used to order bundles. Note the return value is valid as long as the bundle is installed. More...
 
const char * celix_bundle_getSymbolicName (const celix_bundle_t *bnd)
 Returns the symbolic name of the bundle. Note the return value is valid as long as the bundle is installed. More...
 
const char * celix_bundle_getName (const celix_bundle_t *bnd)
 Returns the name of the bundle. Note the return value is valid as long as the bundle is installed. More...
 
const char * celix_bundle_getDescription (const celix_bundle_t *bnd)
 Returns the description of the bundle. Note the return value is valid as long as the bundle is installed. More...
 
bool celix_bundle_isSystemBundle (const celix_bundle_t *bnd)
 Returns whether the bundle is the system bundle. More...
 
celix_array_list_t * celix_bundle_listRegisteredServices (const celix_bundle_t *bnd)
 
void celix_bundle_destroyRegisteredServicesList (celix_array_list_t *list)
 
celix_array_list_t * celix_bundle_listServiceTrackers (const celix_bundle_t *bnd)
 
void celix_bundle_destroyServiceTrackerList (celix_array_list_t *list)
 

Typedef Documentation

◆ celix_bundle_service_list_entry_t

◆ celix_bundle_service_tracker_list_entry_t

Service Tracker Info provided to the service tracker tracker callbacks.

Function Documentation

◆ celix_bundle_destroyRegisteredServicesList()

void celix_bundle_destroyRegisteredServicesList ( celix_array_list_t *  list)

Utils function to free memory for the return of a celix_bundle_listRegisteredServices call.

◆ celix_bundle_destroyServiceTrackerList()

void celix_bundle_destroyServiceTrackerList ( celix_array_list_t *  list)

Utils function to free memory for the return of a celix_bundle_listServiceTrackers call.

◆ celix_bundle_getDescription()

const char* celix_bundle_getDescription ( const celix_bundle_t *  bnd)

Returns the description of the bundle. Note the return value is valid as long as the bundle is installed.

◆ celix_bundle_getEntry()

char* celix_bundle_getEntry ( const celix_bundle_t *  bnd,
const char *  path 
)

Returns a use-able entry path for the provided relative path to a bundle resource.

For example if there is a resource entry in the bundle at path 'META-INF/descriptors/foo.descriptor` this call will return a relative path to the extracted location of the bundle resource, e.g.: .cache/bundle5/version0.0/META-INF/descriptors/foo.descriptor

The caller is responsible for freeing the returned path entry.

Parameters
pathThe relative path to a bundle resource
bndThe bundle
Returns
A use-able path to the bundle resource entry or NULL if the entry is not found.

◆ celix_bundle_getGroup()

const char* celix_bundle_getGroup ( const celix_bundle_t *  bnd)

Returns the group of the bundle. Groups are used to order bundles. Note the return value is valid as long as the bundle is installed.

◆ celix_bundle_getId()

long celix_bundle_getId ( const celix_bundle_t *  bnd)

Returns the bundle id.

Parameters
bndThe bundle
Returns
The bundle id or < 0 if something went wrong.

◆ celix_bundle_getManifestValue()

const char* celix_bundle_getManifestValue ( const celix_bundle_t *  bnd,
const char *  attribute 
)

Get a manifest attribute value from the bundle manifest.

Parameters
bndThe bundle.
attributeThe attribute to get the value from.
Returns
The attribute value or NULL if the attribute is not present in the bundle manifest. The returned value is valid as long as the bundle is not uninstalled.

◆ celix_bundle_getName()

const char* celix_bundle_getName ( const celix_bundle_t *  bnd)

Returns the name of the bundle. Note the return value is valid as long as the bundle is installed.

◆ celix_bundle_getState()

celix_bundle_state_e celix_bundle_getState ( const celix_bundle_t *  bnd)

Returns the bundle state.

Parameters
bndThe bundle
Returns
The bundle state or OSGI_FRAMEWORK_BUNDLE_UNKNOWN if something went wrong.

◆ celix_bundle_getSymbolicName()

const char* celix_bundle_getSymbolicName ( const celix_bundle_t *  bnd)

Returns the symbolic name of the bundle. Note the return value is valid as long as the bundle is installed.

◆ celix_bundle_isSystemBundle()

bool celix_bundle_isSystemBundle ( const celix_bundle_t *  bnd)

Returns whether the bundle is the system bundle.

◆ celix_bundle_listRegisteredServices()

celix_array_list_t* celix_bundle_listRegisteredServices ( const celix_bundle_t *  bnd)

Returns a array list of registered service info entries for this bundle.

Parameters
ctxThe bundle context
bndIdThe bundle id for which the services should be listed
Returns
A celix array list with celix_bundle_service_list_entry_t*. Caller is owner of the celix array.

◆ celix_bundle_listServiceTrackers()

celix_array_list_t* celix_bundle_listServiceTrackers ( const celix_bundle_t *  bnd)

Returns a array list of service tracker info entries for this bundle.

Parameters
ctxThe bundle context
bndIdThe bundle id for which the services should be listed
Returns
A celix array list with celix_bundle_service_tracker_list_entry_t*. Caller is owner of the celix array.