backport for OSGi R4

Hi Holger,

Here is the pull request for the R4 compatibility.

Thanks,
Guillaume