@Override public synchronized void start(StartContext context) throws StartException { List<Deployment> deployments = new ArrayList<Deployment>(); try { ServerEnvironment serverEnvironment = injectedServerEnvironment.getValue(); bundlesPath = LayeredBundlePathFactory.resolveLayeredBundlePath(serverEnvironment); modulecaps = new ArrayList<OSGiCapability>(); List<OSGiCapability> configcaps = new ArrayList<OSGiCapability>(); for (String capspec : SystemPackagesIntegration.DEFAULT_CAPABILITIES) { configcaps.add(new OSGiCapability(capspec, null)); } configcaps.addAll(injectedSubsystemState.getValue().getCapabilities()); Iterator<OSGiCapability> iterator = configcaps.iterator(); while (iterator.hasNext()) { OSGiCapability configcap = iterator.next(); if (installInitialModuleCapability(configcap)) { modulecaps.add(configcap); iterator.remove(); } } for (OSGiCapability configcap : configcaps) { Deployment dep = getInitialBundleDeployment(configcap); deployments.add(dep); } } catch (Exception ex) { throw MESSAGES.startFailedToProcessInitialCapabilites(ex); } // Install the bundles from the given locations installBootstrapBundles(context.getChildTarget(), deployments); }
@Override protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model, ServiceVerificationHandler verificationHandler, List<ServiceController<?>> newControllers) throws OperationFailedException { final Integer startLevel = (operation.hasDefined(ModelConstants.STARTLEVEL) ? FrameworkCapabilityResource.STARTLEVEL.resolveModelAttribute(context, model).asInt() : null); String identifier = operation.get(ModelDescriptionConstants.OP_ADDR).asObject().get(ModelConstants.CAPABILITY).asString(); OSGiCapability module = new OSGiCapability(identifier, startLevel); SubsystemState subsystemState = SubsystemState.getSubsystemState(context); if (subsystemState != null) { subsystemState.addCapability(module); } }
@Override protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model, ServiceVerificationHandler verificationHandler, List<ServiceController<?>> newControllers) throws OperationFailedException { final Integer startLevel = (operation.hasDefined(ModelConstants.STARTLEVEL) ? FrameworkCapabilityResource.STARTLEVEL.resolveModelAttribute(context, model).asInt() : null); String identifier = operation.get(ModelDescriptionConstants.OP_ADDR).asObject().get(ModelConstants.CAPABILITY).asString(); OSGiCapability module = new OSGiCapability(identifier, startLevel); SubsystemState subsystemState = SubsystemState.getSubsystemState(context); if (subsystemState != null) { subsystemState.addCapability(module); } }
configcaps.add(new OSGiCapability(capspec, null));