void setActivation(Activation activation) { if (activationPolicy == activation) return; try { activationPolicy = activation; } finally { notifyObservers(new ChangeEvent(ChangeType.ACTIVATION, false, activation.name())); } }
@Override public void handleRollback(OperationContext context, ModelNode operation) { subsystemState.addCapability(oldVal); } });
@Override public void handleRollback(OperationContext context, ModelNode operation) { subsystemState.setProperty(propName, oldVal); } });
@Override public void registerChildren(ManagementResourceRegistration resourceRegistration) { resourceRegistration.registerSubModel(new FrameworkPropertyResource()); resourceRegistration.registerSubModel(new FrameworkCapabilityResource()); if (registerRuntimeOnly) { resourceRegistration.registerSubModel(new BundleResource()); } } }
public void addCapability(OSGiCapability module) { capabilities.add(module); notifyObservers(new ChangeEvent(ChangeType.CAPABILITY, false, module.getIdentifier().toString())); }
Object setProperty(String name, Object value) { try { if (value == null) return properties.remove(name); else return properties.put(name, value); } finally { notifyObservers(new ChangeEvent(ChangeType.PROPERTY, value == null, name)); } }
FrameworkCapabilityResource() { super(CAPABILITY_PATH, OSGiResolvers.getResolver(ModelConstants.CAPABILITY), OSGiCapabilityAdd.INSTANCE, OSGiCapabilityRemove.INSTANCE); }
public String toString() { return getLocalName(); } }
@Override protected void revertUpdateToRuntime(OperationContext context, ModelNode operation, String attributeName, ModelNode valueToRestore, ModelNode valueToRevert, Object handback) throws OperationFailedException { doUpdate(context, operation, valueToRestore); }
public String toString() { return getLocalName(); } }
public String toString() { return getLocalName(); } }
void setActivation(Activation activation) { if (activationPolicy == activation) return; try { activationPolicy = activation; } finally { notifyObservers(new ChangeEvent(ChangeType.ACTIVATION, false, activation.name())); } }
@Override public void registerChildren(ManagementResourceRegistration resourceRegistration) { resourceRegistration.registerSubModel(new FrameworkPropertyResource()); resourceRegistration.registerSubModel(new FrameworkCapabilityResource()); if (registerRuntimeOnly) { resourceRegistration.registerSubModel(new BundleResource()); } } }
String setProperty(String name, String value) { try { if (value == null) return properties.remove(name); else return properties.put(name, value); } finally { notifyObservers(new ChangeEvent(ChangeType.PROPERTY, value == null, name)); } }
FrameworkPropertyResource() { super(PROPERTY_PATH, OSGiResolvers.getResolver("framework.property"), OSGiFrameworkPropertyAdd.INSTANCE, OSGiFrameworkPropertyRemove.INSTANCE); }
@Override public void handleRollback(OperationContext context, ModelNode operation) { subsystemState.addCapability(oldVal); } });
@Override public void handleRollback(OperationContext context, ModelNode operation) { subsystemState.setProperty(propName, oldVal); } });
public String toString() { return getLocalName(); } }
FrameworkCapabilityResource() { super(CAPABILITY_PATH, OSGiResolvers.getResolver(ModelConstants.CAPABILITY), OSGiCapabilityAdd.INSTANCE, OSGiCapabilityRemove.INSTANCE); }
FrameworkPropertyResource() { super(PROPERTY_PATH, OSGiResolvers.getResolver("framework.property"), OSGiFrameworkPropertyAdd.INSTANCE, OSGiFrameworkPropertyRemove.INSTANCE); }