Uploaded image for project: 'WildFly Core'
  1. WildFly Core
  2. WFCORE-2288

Indexed adds for override models of ordered child types does not work

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 3.0.0.Alpha25
    • 3.0.0.Alpha24
    • Management
    • None

    Description

      This is due to the following logic in AbstractAddStepHandler:

          protected Resource createResource(final OperationContext context, final ModelNode operation) {
              ImmutableManagementResourceRegistration registration = context.getResourceRegistration();
              if (registration != null) {
                  Set<String> orderedChildTypes = registration.getOrderedChildTypes();
                  boolean orderedChildResource = registration.isOrderedChildResource();
                  if (orderedChildResource || orderedChildTypes.size() > 0) {
                      return new OrderedResourceCreator(orderedChildResource, orderedChildTypes).createResource(context, operation);
                  }
              }
              return createResource(context);
          }
      

      Override models fail to use the OrderedResourceCreator because registration.isOrderedChildResource() returns false.

      There are a number of ways to handle this:
      1. Allow override model registration to indicate that they are ordered. Currently, the MRR implementation throws an exception if an override model registration tries to specify that it is ordered, and the corresponding wildcard registration is ordered.
      2. Auto-set override model registrations to be ordered if the corresponding wildcard registration is ordered.
      3. In AbstractAddStepHandler, when determining whether or not to use an OrderedResourceCreator, test if either registration.isOrderedChildResource() is true or, if a wildcard registration exists, check if its registration.isOrderedChildResource() is true.

      Of these three options, #3 is probably the easiest, and most sensible solution.

      Attachments

        Activity

          People

            bstansbe@redhat.com Brian Stansberry
            pferraro@redhat.com Paul Ferraro
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: