public void start(final StartContext context) throws StartException { ServiceController<?> controller = context.getController(); LOGGER.tracef("Starting: %s", controller.getName()); List<Bundle> bundles = new ArrayList<Bundle>(installedBundles); Collections.sort(bundles, new BundleComparator()); for (Bundle bundle : bundles) { TypeAdaptor adaptor = (TypeAdaptor) bundle; Deployment dep = adaptor.adapt(Deployment.class); OSGiMetaData metadata = adaptor.adapt(OSGiMetaData.class); if (dep.isAutoStart() && metadata.getFragmentHost() == null) { try { bundle.start(Bundle.START_ACTIVATION_POLICY); } catch (BundleException ex) { LOGGER.errorCannotStartBundle(ex, bundle); } } } LOGGER.debugf("Started: %s", controller.getName()); installedBundles = null; tracker = null; }