protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) { if (context.isResourceServiceRestartAllowed()) { final PathAddress address = PathAddress.pathAddress(operation.require(OP_ADDR)); final String name = address.getLastElement().getValue(); context.removeService(serviceName(name)); } else { context.reloadRequired(); } }
/** * Determines the dynamic portion of the dependent capability's name. Only invoked if {@code * dynamicDependent} is set to {@code true} in the constructor. * * <p>This base implementation returns the value of the last element in {@code currentAddress}. * Subclasses that wish to extract the relevant name from some other element in the address may * override this. * * @param currentAddress the address of the resource currently being processed. Will not be * {@code null} * @return the dynamic portion of the dependenty capability name. Cannot be {@code null} */ protected String getDynamicDependentName(PathAddress currentAddress) { return currentAddress.getLastElement().getValue(); }