Pepijn Noltes created CELIX-439:
-----------------------------------

             Summary: Add bundle function to reduce the need of bundle 
archive/revision/module
                 Key: CELIX-439
                 URL: https://issues.apache.org/jira/browse/CELIX-439
             Project: Celix
          Issue Type: Improvement
          Components: Framework
    Affects Versions: 2.3.0
            Reporter: Pepijn Noltes


To retrieve some info about the bundle current required functiions can be 
cumbersome. e..g to retrieve the cache root, your need:
bundle_context_t *ctx = ...
bundle_pt and = NULL;
bundle_archive_pt arch = NULL;
bundle_revision_pt rev = NULL;
const char *root = NULL;
bundleContext_getBundle(ctx, &bnd);
bundle_getArchive(and, &arch)
bundleArchive_getCurrentRevision(arch, &rev);
bundleRevision_getRoot(rev, &root);

And this is without error checking.


Adds some api to the bundle.h to that most data can be received from the 
bundle. In the future it should be possible to make 
bundle_archive/module/revision private.

Proposed added API:
/**
 * Returns the bundle version or NULL of bnd is NULL.
 * Caller needs to free the returned char pointer.
 */
char * bundle_getBundleVersion(bundle_t *bnd);

/**
 * Returns the bundle name or NULL of bnd is NULL.
 * Caller needs to free the returned char pointer.
 */
char * bundle_getBundleName(bundle_t *bnd);

/**
 * Returns the bundle symbolic name or NULL of bnd is NULL.
 * Caller needs to free the returned char pointer.
 */
char * bundle_getBundleSymbolic(bundle_t *bnd);

/**
 * Returns the bundle manifest as properties or NULL of bnd is NULL.
 * Caller needs to destroy the returned properties.
 */
properties_t *bundle_getManifestAsProperties(bundle_t* bnd);

/**
 * Returns the bundle cache dir (i.e. bundle revision root) or NULL of bnd is 
NULL.
 * Caller needs to free the returned char pointer.
 */
char *bundleRevision_getCacheDir(bundle_t *bnd);



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to