I always hate to suggest using FrameworkUtil.getBundle().getBundleContext()
because it's such a hack, but in this case it seems to be the only solution.
You will need to pass in a class that is defined by the host bundle, because fragments cannot have a BundleContext (i.e. the getBundleContext
call would return null).