PackageAdmin does what I think you're looking for

Pseudo

val padminService = getPackageAdminService(context);
val package = padminService.getExportedPackage("javax.swing"); //Highest
version returned
package.getExportingBundle()

I'm not sure what you want to do but the following 4 classes should cover
your needs I think:
http://www.osgi.org/javadoc/r4v42/org/osgi/service/packageadmin/PackageAdmin.html
http://www.osgi.org/javadoc/r4v42/org/osgi/framework/BundleContext.html
http://www.osgi.org/javadoc/r4v42/org/osgi/framework/Bundle.html
http://www.osgi.org/javadoc/r4v42/org/osgi/service/packageadmin/ExportedPackage.html

With these, you can get all installed bundles (from the bundle context) and
all exported packages (from package admin). From there you can do pretty
much any query you want. :)

/Per-Erik


On Mon, Jan 3, 2011 at 2:56 PM, Pierre Henry Perret <[email protected]>wrote:

> Hi,
>
> I'd like to know if find a bundle contains and export a certain package.
> Is there a reference for that ?
>
> Pierre
>

Reply via email to