@Override
  public ManagementResourceRegistration registerOverrideModel(
      String name, OverrideDescriptionProvider descriptionProvider) {
    Assert.checkNotNullParam("name", name);
    Assert.checkNotNullParam("descriptionProvider", descriptionProvider);

    if (parent == null) {
      throw ControllerLogger.ROOT_LOGGER.cannotOverrideRootRegistration();
    }

    if (!PathElement.WILDCARD_VALUE.equals(valueString)) {
      throw ControllerLogger.ROOT_LOGGER.cannotOverrideNonWildCardRegistration(valueString);
    }
    PathElement pe = PathElement.pathElement(parent.getKeyName(), name);

    final SimpleResourceDefinition rd =
        new SimpleResourceDefinition(
            pe,
            new OverrideDescriptionCombiner(
                getModelDescription(PathAddress.EMPTY_ADDRESS), descriptionProvider)) {

          @Override
          public List<AccessConstraintDefinition> getAccessConstraints() {
            return AbstractResourceRegistration.this.getAccessConstraints();
          }
        };
    return parent.getParent().registerSubModel(rd);
  }
 @Override
 public void unregisterOverrideModel(String name) {
   Assert.checkNotNullParam("name", name);
   if (PathElement.WILDCARD_VALUE.equals(name)) {
     throw ControllerLogger.ROOT_LOGGER.wildcardRegistrationIsNotAnOverride();
   }
   if (parent == null) {
     throw ControllerLogger.ROOT_LOGGER.rootRegistrationIsNotOverridable();
   }
   PathElement pe = PathElement.pathElement(parent.getKeyName(), name);
   parent.getParent().unregisterSubModel(pe);
 }
  /** {@inheritDoc} */
  @Override
  public final ManagementResourceRegistration getOverrideModel(String name) {

    Assert.checkNotNullParam("name", name);

    if (parent == null) {
      throw ControllerLogger.ROOT_LOGGER.cannotOverrideRootRegistration();
    }

    if (!PathElement.WILDCARD_VALUE.equals(valueString)) {
      throw ControllerLogger.ROOT_LOGGER.cannotOverrideNonWildCardRegistration(valueString);
    }
    PathElement pe = PathElement.pathElement(parent.getKeyName(), name);

    // TODO https://issues.jboss.org/browse/WFLY-2883
    //        ManagementResourceRegistration candidate =
    // parent.getParent().getSubModel(PathAddress.pathAddress(pe));
    //        // We may have gotten back the wildcard reg; detect this by checking for allowing
    // override
    //        return candidate.isAllowsOverride() ? null : candidate;
    return parent.getParent().getSubModel(PathAddress.pathAddress(pe));
  }
 @Override
 public boolean isAllowsOverride() {
   checkPermission();
   return !isRemote() && parent != null && PathElement.WILDCARD_VALUE.equals(valueString);
 }
 /** Gets whether this registration has an alternative wildcard registration */
 boolean hasNoAlternativeWildcardRegistration() {
   return parent == null
       || PathElement.WILDCARD_VALUE.equals(valueString)
       || !parent.getChildNames().contains(PathElement.WILDCARD_VALUE);
 }