code: @Override
      protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) {
          if (context.isResourceServiceRestartAllowed()) {
  
              final PathAddress address = context.getCurrentAddress();
              final String name = address.getLastElement().getValue();
  
              ServiceName nonCapabilityServiceName = serviceName(name, address);
              if (nonCapabilityServiceName != null) {
                  context.removeService(serviceName(name, address));
              }
  
              Set<RuntimeCapability> capabilitySet = unavailableCapabilities.isEmpty() ? context.getResourceRegistration().getCapabilities() : unavailableCapabilities;
  
              for (RuntimeCapability<?> capability : capabilitySet) {
                  if (capability.getCapabilityServiceValueType() != null) {
                      context.removeService(capability.getCapabilityServiceName(address));
                  }
              }
          } else {
              context.reloadRequired();
          }
      }
docs: If the {@link OperationContext#isResourceServiceRestartAllowed() context allows resource removal},
  removes services; otherwise puts the process in reload-required state. The following services are
  removed:
  <ul>
  <li>The service named by the value returned from {@link #serviceName(String, PathAddress)}, if there is one</li>
  <li>The service names associated with any {@code unavailableCapabilities}
  passed to the constructor.</li>
  </ul>
  
  {@inheritDoc}