1

I'm trying to get a list of bundles that are either importing a service my bundle is exporting (I can't find a way to get other bundles manifest) or to get a list of bundles subscribed to the services my bundle is publishing.

So far I'm trying to list all the ServiceReferences the other bundles are using to see if they're using mine, without success.

Thank you.

user2256799
  • 229
  • 1
  • 3
  • 10

2 Answers2

1

Using the ServiceReference for the registered service, you can call the getUsingBundles method to find the bundles which are currently using the service.

BJ Hargrave
  • 9,324
  • 1
  • 19
  • 27
1

You could also try this (in the OSGi console):

install http://downloads.skysail.io/skysail-webconsole/webconsole.all.jar
start <id of the new bundle>

open http://localhost:2002 in your browser and navigate to "Services" click on the service in question check the "Using Bundles" row of the Services Details page

Please note that this project (https://github.com/evandor/skysail-webconsole) currently is a proof-of-concept only. But it might already be useful for some use cases.

(I'm happy about any kind of feedback btw ;)

evandor
  • 799
  • 1
  • 10
  • 23