Reputation: 99
For one of a monitoring project I need to find out the class names available in a OSGI bundle (apache Karaf). I checked in the bundle and bundleContext class, but could not find any relevant methods to get the class names. Please help!!
PS - i can get the list of classes using bundle:class command. But i would like to get from the code.
EDIT - It is not 1 bundle for which i need to know, i want to run the code in any karaf environment to find all the bundles and also class names in those bundles.
Upvotes: 1
Views: 1088
Reputation: 19626
You can simply do the same that apache karaf does See the source of the classes command: https://github.com/apache/karaf/blob/master/bundle/core/src/main/java/org/apache/karaf/bundle/command/Classes.java
Upvotes: 1