@Override public void handleRollback(OperationContext context, ModelNode operation) { subsystemState.setProperty(propName, oldVal); } });
@Override public void handleRollback(OperationContext context, ModelNode operation) { subsystemState.setProperty(propName, oldVal); } });
private boolean doUpdate(OperationContext context, ModelNode operation, ModelNode value) { String propName = operation.get(ModelDescriptionConstants.OP_ADDR).asObject().get(ModelConstants.PROPERTY).asString(); String propValue = value.asString(); SubsystemState subsystemState = SubsystemState.getSubsystemState(context); if (subsystemState != null) { subsystemState.setProperty(propName, propValue); } return true; } }
private boolean doUpdate(OperationContext context, ModelNode operation, ModelNode value) { String propName = operation.get(ModelDescriptionConstants.OP_ADDR).asObject().get(ModelConstants.PROPERTY).asString(); String propValue = value.asString(); SubsystemState subsystemState = SubsystemState.getSubsystemState(context); if (subsystemState != null) { subsystemState.setProperty(propName, propValue); } return true; } }
@Override protected void rollbackRuntime(OperationContext context, ModelNode operation, ModelNode model, List<ServiceController<?>> controllers) { String propName = operation.get(ModelDescriptionConstants.OP_ADDR).asObject().get(ModelConstants.PROPERTY).asString(); SubsystemState subsystemState = SubsystemState.getSubsystemState(context); if (subsystemState != null) { subsystemState.setProperty(propName, null); } }
@Override protected void rollbackRuntime(OperationContext context, ModelNode operation, ModelNode model, List<ServiceController<?>> controllers) { String propName = operation.get(ModelDescriptionConstants.OP_ADDR).asObject().get(ModelConstants.PROPERTY).asString(); SubsystemState subsystemState = SubsystemState.getSubsystemState(context); if (subsystemState != null) { subsystemState.setProperty(propName, null); } }
@Override protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model, ServiceVerificationHandler verificationHandler, List<ServiceController<?>> newControllers) throws OperationFailedException { String propName = operation.get(ModelDescriptionConstants.OP_ADDR).asObject().get(ModelConstants.PROPERTY).asString(); String propValue = FrameworkPropertyResource.VALUE.resolveModelAttribute(context, model).asString(); SubsystemState subsystemState = SubsystemState.getSubsystemState(context); if (subsystemState != null) { subsystemState.setProperty(propName, propValue); } }
@Override protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model, ServiceVerificationHandler verificationHandler, List<ServiceController<?>> newControllers) throws OperationFailedException { String propName = operation.get(ModelDescriptionConstants.OP_ADDR).asObject().get(ModelConstants.PROPERTY).asString(); String propValue = FrameworkPropertyResource.VALUE.resolveModelAttribute(context, model).asString(); SubsystemState subsystemState = SubsystemState.getSubsystemState(context); if (subsystemState != null) { subsystemState.setProperty(propName, propValue); } }
@Override protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { final String propName = operation.get(ModelDescriptionConstants.OP_ADDR).asObject().get(ModelConstants.PROPERTY).asString(); final SubsystemState subsystemState = SubsystemState.getSubsystemState(context); if (subsystemState == null) { // cannot complete context.setRollbackOnly(); context.completeStep(OperationContext.RollbackHandler.NOOP_ROLLBACK_HANDLER); return; } final Object oldVal = subsystemState.setProperty(propName, null); context.completeStep(new OperationContext.RollbackHandler() { @Override public void handleRollback(OperationContext context, ModelNode operation) { subsystemState.setProperty(propName, oldVal); } }); } }
@Override protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { final String propName = operation.get(ModelDescriptionConstants.OP_ADDR).asObject().get(ModelConstants.PROPERTY).asString(); final SubsystemState subsystemState = SubsystemState.getSubsystemState(context); if (subsystemState == null) { // cannot complete context.setRollbackOnly(); context.completeStep(OperationContext.RollbackHandler.NOOP_ROLLBACK_HANDLER); return; } final String oldVal = subsystemState.setProperty(propName, null); context.completeStep(new OperationContext.RollbackHandler() { @Override public void handleRollback(OperationContext context, ModelNode operation) { subsystemState.setProperty(propName, oldVal); } }); } }