+ public List<OsgiBundle> listModules() {
+ List<OsgiBundle> modules = new ArrayList<OsgiBundle>();
+ Bundle[] bundles = bundleContext.getBundles();
+ for (Bundle bundle : bundles) {
+ OsgiBundle osgiBundle = new OsgiBundle(bundle);
+ modules.add(osgiBundle);
+ String location = bundle.getLocation();
+ if (location != null) {
+ Resource resource = resourceLoader.getResource(location);
+ osgiBundle.setDistribution(new ResourceDistribution(resource));
+ }
+ }
+ return modules;