Hello OSGi experts,

In a subsystem manifest we can declare provided capabilities using the header "Provide-Capability:".

I'm trying to get them using the bundle context from the subsystem service (injected by DS):

List<Capability> caps = pScopeSubsystem.getBundleContext()
                    .getBundle().adapt(BundleRevision.class)
                    .getCapabilities(null);
            for (Capability capability : caps) {
                System.out.println("Cap: " + capability.toString());
            }

Also tried BundleWiring:

BundleWiring bw = pKernelSubsystem.getBundleContext().getBundle()
                    .adapt(BundleWiring.class);
List<BundleCapability> capabilities = bw.getCapabilities(null);

But the only capabilities that I was able to get are those:

Cap: osgi.wiring.bundle; bundle-version:Version="1.0.0"; osgi.wiring.bundle="org.osgi.service.subsystem.region.context.1" Cap: osgi.wiring.host; bundle-version:Version="1.0.0"; osgi.wiring.host="org.osgi.service.subsystem.region.context.1" Cap: osgi.identity; osgi.identity="org.osgi.service.subsystem.region.context.1"; type="osgi.bundle"; version:Version="1.0.0"

So, what is the way to get the custom capabilities declared for a scope subsystem?


many thanks,

Cristiano

_______________________________________________
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to