Hi all,
I have a look to the Bundle Wiring API Specification of osgi 5 and I found
easily how to get the bundle imported by a bundle A. But for me it is not
obvious how I can get the resolution attribute of an import package requirement.
More formally I want to know if my import package is optional or not.
Here is the code from the spec how to Finding the Imported Packages:
void printImports( Bundle A ) {
BundleWiring wA = A.adapt( BundleWiring.class );
for ( BundleWire wire : wA.getRequiredWires(PACKAGE_NAMESPACE)) {
String pack = (String)
wire.getCapability().getAttributes().get(PACKAGE_NAMESPACE);
Bundle bundle = wire.getProviderWiring().getBundle());
System.out.println(pack + " - " + bundle.getLocation());
}
}
It just work perfectly for the first part but I don't know how to get the
resolution attribute?
Could you help me?
Thanks in advance,
Romain.
"Misys" is the trade name of the Misys group of companies. This email and any
attachments have been scanned for known viruses using multiple scanners. This
email message is intended for the named recipient only. It may be privileged
and/or confidential. If you are not the named recipient of this email please
notify us immediately and do not copy it or use it for any purpose, nor
disclose its contents to any other person. This email does not constitute the
commencement of legal relations between you and Misys. Please refer to the
executed contract between you and the relevant member of the Misys group for
the identity of the contracting party with which you are dealing.
_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev