With OSGi 4.3, I understand PackageAdmin
has been deprecated. How do you then find the fragments for a specific bundle - i.e. what is the alternative to PackageAdmin.getFragments(Bundle bundle)
?
Use the BundleWiring API to find the provided wires in the osgi.wiring.host
namespace:
BundleWiring myWiring = myBundle.adapt(BundleWiring.class);
List<BundleWire> wires = myWiring.getProvidedWires(HostNamespace.HOST_NAMESPACE);
for (BundleWire wire : wires) {
Bundle fragment = wire.getRequirerWiring().getBundle();
}