Hummm... :-\

I was about to create a kind of extender provider tracking on the subsystem capabilities... will need to rethink it then...

thanks BJ.

On 16/05/2017 22:09, BJ Hargrave wrote:
I doubt it. The region bundles don't provide or require the capabilities themselves. You will probably need to use the subsystem service to get the subsystem manifest and parse the headers yourself.

BJ Hargrave
Senior Technical Staff Member, IBM // office: +1 386 848 1781
OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788

    ----- Original message -----
    From: Cristiano Gavião <>
    Sent by:
    To: OSGi Developer Mail List <>
    Subject: [osgi-dev] How to get the custom capabilities provided by
    a scoped subsystem ?
    Date: Tue, May 16, 2017 4:46 PM
    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:; bundle-version:Version="1.0.0";
    > 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

    many thanks,


    OSGi Developer Mail List

OSGi Developer Mail List

OSGi Developer Mail List

Reply via email to