+ protected void checkUnresolved() {
+ // Refresh
+ ServiceReference packageAdminRef = bundleContext
+ .getServiceReference(PackageAdmin.class.getName());
+ PackageAdmin packageAdmin = (PackageAdmin) bundleContext
+ .getService(packageAdminRef);
+ packageAdmin.resolveBundles(null);
+
+ Bundle[] bundles = bundleContext.getBundles();
+ List /* Bundle */unresolvedBundles = new ArrayList();
+ for (int i = 0; i < bundles.length; i++) {
+ int bundleState = bundles[i].getState();
+ if (!(bundleState == Bundle.ACTIVE
+ || bundleState == Bundle.RESOLVED || bundleState == Bundle.STARTING))
+ unresolvedBundles.add(bundles[i]);
+ }
+
+ if (unresolvedBundles.size() != 0) {
+ warn("Unresolved bundles " + unresolvedBundles);
+ }
+ }
+