configcaps.add(new OSGiCapability(capspec, null)); while (iterator.hasNext()) { OSGiCapability configcap = iterator.next(); String identifier = configcap.getIdentifier(); if (isValidModuleIdentifier(identifier)) { try { String identifier = configcap.getIdentifier(); try { Deployment dep = getInitialBundleDeployment(configcap);
private boolean installInitialModuleCapability(OSGiCapability configcap) throws Exception { String identifier = configcap.getIdentifier(); if (isValidModuleIdentifier(identifier)) { ModuleIdentifier moduleId = ModuleIdentifier.fromString(identifier); Integer bundleStartLevel = configcap.getStartLevel(); if (bundleStartLevel != null && bundleStartLevel > 0) { StartLevel plugin = injectedStartLevel.getValue();
private Module installInitialModuleCapability(OSGiCapability configcap) throws Exception { String identifier = configcap.getIdentifier(); ModuleIdentifier moduleId = ModuleIdentifier.fromString(identifier); Integer startlevel = configcap.getStartLevel(); if (startlevel != null && startlevel > 0) { XBundle bundle = brev.getBundle();
private Deployment getInitialBundleDeployment(OSGiCapability configcap) throws Exception { String identifier = configcap.getIdentifier(); Integer level = configcap.getStartLevel();
@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); }
private Deployment getInitialBundleDeployment(OSGiCapability configcap) throws Exception { String identifier = configcap.getIdentifier(); Integer level = configcap.getStartLevel();
@Override public void start(StartContext context) throws StartException { // Start the module capabilities that have a start level assigned BundleManager bundleManager = injectedBundleManager.getValue(); for (OSGiCapability modcap : modulecaps) { if (modcap.getStartLevel() != null) { String identifier = modcap.getIdentifier(); XBundle bundle = bundleManager.getBundleByLocation(identifier); try { bundle.start(Bundle.START_ACTIVATION_POLICY); } catch (BundleException ex) { LOGGER.errorCannotStartBundle(ex, bundle); } } } // Start the bundle capabilities super.start(context); } }
@Override public void start(StartContext context) throws StartException { // Start the module capabilities that have a start level assigned BundleManager bundleManager = injectedBundleManager.getValue(); for (OSGiCapability modcap : modulecaps) { if (modcap.getStartLevel() != null) { String identifier = modcap.getIdentifier(); XBundle bundle = bundleManager.getBundleByLocation(identifier); try { bundle.start(Bundle.START_ACTIVATION_POLICY); } catch (BundleException ex) { LOGGER.errorCannotStartBundle(ex, bundle); } } } // Start the bundle capabilities super.start(context); } }
public OSGiCapability removeCapability(String id) { synchronized (capabilities) { for (Iterator<OSGiCapability> it = capabilities.iterator(); it.hasNext(); ) { OSGiCapability module = it.next(); if (module.getIdentifier().equals(id)) { it.remove(); notifyObservers(new ChangeEvent(ChangeType.CAPABILITY, true, id)); return module; } } return null; } }
public void addCapability(OSGiCapability module) { capabilities.add(module); notifyObservers(new ChangeEvent(ChangeType.CAPABILITY, false, module.getIdentifier().toString())); }
@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); } }
public OSGiCapability removeCapability(String id) { synchronized (capabilities) { for (Iterator<OSGiCapability> it = capabilities.iterator(); it.hasNext(); ) { OSGiCapability module = it.next(); if (module.getIdentifier().equals(id)) { it.remove(); notifyObservers(new ChangeEvent(ChangeType.CAPABILITY, true, id)); return module; } } return null; } }
public void addCapability(OSGiCapability module) { capabilities.add(module); notifyObservers(new ChangeEvent(ChangeType.CAPABILITY, false, module.getIdentifier().toString())); }