ServiceContainer serviceContainer = context.getController().getServiceContainer();
sysContext.registerService(ServiceContainer.class.getName(), serviceContainer, null);
// Create the list of {@link Deployment}s for the configured modules
List<Deployment> deployments = new ArrayList<Deployment>();
BundleDeploymentPlugin depPlugin = bundleManager.getPlugin(BundleDeploymentPlugin.class);
for (OSGiModule moduleMetaData : subsystemState.getModules()) {
ModuleIdentifier identifier = moduleMetaData.getIdentifier();
ModuleLoader moduleLoader = Module.getSystemModuleLoader();
Module module = moduleLoader.loadModule(identifier);
Deployment dep = depPlugin.createDeployment(module);
dep.setAutoStart(moduleMetaData.isStart());
deployments.add(dep);
}
// Deploy the bundles through the {@link SystemDeployerService}