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
hargr...@us.ibm.com
 
 
----- Original message -----
From: Cristiano Gavião <cvgav...@gmail.com>
Sent by: osgi-dev-boun...@mail.osgi.org
To: OSGi Developer Mail List <osgi-dev@mail.osgi.org>
Cc:
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: 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

 
 

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

Reply via email to