Question

I've created a system bundle fragment for a host bundle using this:

Fragment-Host: system.bundle;extension:=framework

I would like to know the version of the fragment inside the system bundle activator method. there is way to get that ?

If I use the context parameter of the activator method I can get the system bundle but couldn't find how to get its fragments...

thanks in advance.

Was it helpful?

Solution

Check OSGi Core Spec 5.0 (7.2.x chapter)

  BundleWiring wA = systemBundleContext.getBundle().adapt( BundleWiring.class );
  for ( BundleWire wire : wA.getProvidedWires(HOST_NAMESPACE)) {
    // fragment bundle version
    wire.getRequirerWiring().getResource().getVersion();
  }
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top