@Override protected void removeServices(OperationContext context, ServiceName parentService, ModelNode parentModel) throws OperationFailedException { super.removeServices(context, parentService, parentModel); context.removeService(AbstractPersistentSessionManager.SERVICE_NAME); }
@Override protected void updateModel(OperationContext context, ModelNode operation) throws OperationFailedException { Resource r = context.readResource(PathAddress.EMPTY_ADDRESS, false); //to make sure resource we are removing exists! it will throw exception. super.updateModel(context, operation); recordCapabilitiesAndRequirements(context, r); }
/** * Performs the update to the persistent configuration model. This default implementation simply removes * the targeted resource. * * @param context the operation context * @param operation the operation * @throws OperationFailedException if there is a problem updating the model */ protected void updateModel(final OperationContext context, final ModelNode operation) throws OperationFailedException { // verify that the resource exist before removing it context.readResource(PathAddress.EMPTY_ADDRESS, false); Resource resource = context.removeResource(PathAddress.EMPTY_ADDRESS); recordCapabilitiesAndRequirements(context, operation, resource); }
/** * Performs the update to the persistent configuration model. This default implementation simply removes * the targeted resource. * * @param context the operation context * @param operation the operation * @throws OperationFailedException if there is a problem updating the model */ protected void updateModel(final OperationContext context, final ModelNode operation) throws OperationFailedException { // verify that the resource exist before removing it context.readResource(PathAddress.EMPTY_ADDRESS, false); Resource resource = context.removeResource(PathAddress.EMPTY_ADDRESS); recordCapabilitiesAndRequirements(context, operation, resource); }
@Override protected void updateModel(OperationContext context, ModelNode operation) throws OperationFailedException { checkIfLastIdentityStore(context); super.updateModel(context, operation); context.addStep(new OperationStepHandler() { @Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { PathAddress address = context.getCurrentAddress(); String configurationName = address.getElement(address.size() - 2).getValue(); String partitionManagerName = address.getElement(address.size() - 3).getValue(); String identityStoreName = address.getLastElement().getValue(); context.removeService(PartitionManagerService.createIdentityStoreServiceName(partitionManagerName, configurationName, identityStoreName)); context.completeStep(OperationContext.ResultHandler.NOOP_RESULT_HANDLER); } }, OperationContext.Stage.RUNTIME); }
@Override protected void removeServices(OperationContext context, ServiceName parentService, ModelNode parentModel) throws OperationFailedException { super.removeServices(context, parentService, parentModel); String jndiName = MailSessionAdd.getJndiName(parentModel, context); final ContextNames.BindInfo bindInfo = ContextNames.bindInfoFor(jndiName); context.removeService(bindInfo.getBinderServiceName()); } //todo workaround until it is supported on abstract classes
@Override protected void updateModel(OperationContext context, ModelNode operation) throws OperationFailedException { checkIfLastIdentityStore(context); super.updateModel(context, operation); context.addStep(new OperationStepHandler() { @Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { PathAddress address = context.getCurrentAddress(); String configurationName = address.getElement(address.size() - 2).getValue(); String partitionManagerName = address.getElement(address.size() - 3).getValue(); String identityStoreName = address.getLastElement().getValue(); context.removeService(PartitionManagerService.createIdentityStoreServiceName(partitionManagerName, configurationName, identityStoreName)); context.completeStep(OperationContext.ResultHandler.NOOP_RESULT_HANDLER); } }, OperationContext.Stage.RUNTIME); }
@Override protected void removeServices(OperationContext context, ServiceName parentService, ModelNode parentModel) throws OperationFailedException { super.removeServices(context, parentService, parentModel); context.removeService(AbstractPersistentSessionManager.SERVICE_NAME); }
@Override protected void updateModel(OperationContext context, ModelNode operation) throws OperationFailedException { PathAddress partitionManagerAddress = getParentAddress(context.getCurrentAddress()); Resource partitionManagerResource = context.readResourceFromRoot(partitionManagerAddress); checkIfLastConfiguration(partitionManagerResource); ModelNode originalParentModel = Resource.Tools.readModel(partitionManagerResource); super.updateModel(context, operation); context.addStep(new OperationStepHandler() { @Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { PartitionManagerRemoveHandler.INSTANCE .removeIdentityStoreServices(context, originalParentModel, partitionManagerAddress.getLastElement().getValue(), context.getCurrentAddressValue()); context.completeStep(OperationContext.ResultHandler.NOOP_RESULT_HANDLER); } }, OperationContext.Stage.RUNTIME); }
@Override protected void removeServices(OperationContext context, ServiceName parentService, ModelNode parentModel) throws OperationFailedException { super.removeServices(context, parentService, parentModel); context.removeService(AbstractPersistentSessionManager.SERVICE_NAME); }
@Override protected void updateModel(OperationContext context, ModelNode operation) throws OperationFailedException { PathAddress partitionManagerAddress = getParentAddress(context.getCurrentAddress()); Resource partitionManagerResource = context.readResourceFromRoot(partitionManagerAddress); checkIfLastConfiguration(partitionManagerResource); ModelNode originalParentModel = Resource.Tools.readModel(partitionManagerResource); super.updateModel(context, operation); context.addStep(new OperationStepHandler() { @Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { PartitionManagerRemoveHandler.INSTANCE .removeIdentityStoreServices(context, originalParentModel, partitionManagerAddress.getLastElement().getValue(), context.getCurrentAddressValue()); context.completeStep(OperationContext.ResultHandler.NOOP_RESULT_HANDLER); } }, OperationContext.Stage.RUNTIME); }
@Override protected void updateModel(OperationContext context, ModelNode operation) throws OperationFailedException { super.updateModel(context, operation); PathAddress partitionManagerAddress = getParentAddress(PathAddress.pathAddress(operation.require(OP_ADDR))); Resource partitionManagerResource = context.readResourceFromRoot(partitionManagerAddress); ModelNode parentModel = Resource.Tools.readModel(partitionManagerResource); PartitionManagerAddHandler.INSTANCE.validateModel(context, partitionManagerAddress.getLastElement().getValue(), parentModel); }
@Override protected void updateModel(OperationContext context, ModelNode operation) throws OperationFailedException { super.updateModel(context, operation); PathAddress partitionManagerAddress = getParentAddress(PathAddress.pathAddress(operation.require(OP_ADDR))); Resource partitionManagerResource = context.readResourceFromRoot(partitionManagerAddress); ModelNode parentModel = Resource.Tools.readModel(partitionManagerResource); PartitionManagerAddHandler.INSTANCE.validateModel(context, partitionManagerAddress.getLastElement().getValue(), parentModel); }