code: static ModifiableKeyStoreService getModifiableKeyStoreService(OperationContext context) throws OperationFailedException {
          ServiceRegistry serviceRegistry = context.getServiceRegistry(true);
          PathAddress currentAddress = context.getCurrentAddress();
          RuntimeCapability<Void> runtimeCapability = KEY_STORE_RUNTIME_CAPABILITY.fromBaseCapability(currentAddress.getLastElement().getValue());
          ServiceName serviceName = runtimeCapability.getCapabilityServiceName();
  
          ServiceController<KeyStore> serviceContainer = getRequiredService(serviceRegistry, serviceName, KeyStore.class);
          ServiceController.State serviceState = serviceContainer.getState();
          if (serviceState != ServiceController.State.UP) {
              throw ROOT_LOGGER.requiredServiceNotUp(serviceName, serviceState);
          }
  
          return (ModifiableKeyStoreService) serviceContainer.getService();
      }
docs: Try to obtain a modifiable {@link KeyStoreService} based on the given {@link OperationContext}.
  
  @param context the current context
  @return the modifiable KeyStore service
  @throws OperationFailedException if an error occurs while attempting to obtain the modifiable KeyStore service