Reputation: 438
I'm loading 3 small OSGI bundles with Karaf (bundles A, B, C). Each bundle is composed of one Activator class which implements the start and stop methods. From bundle A's start method I would like to print out a list of all installed bundles.
output: Bundle A's name, Bundle B's name, Bundle C's name
How would I do this?
Upvotes: 2
Views: 1302
Reputation: 6046
for (Bundle bundle : bundleContext.getBundles()) {
System.out.println("Symbolic-Name: " + bundle.getSymbolicName());
System.out.println(" Version: " + bundle.getVersion());
// And printing other info
}
Upvotes: 3