Paul Ferraro created WFCORE-2288:
------------------------------------
Summary: Indexed adds for override models of ordered child types does not
work
Key: WFCORE-2288
URL:
https://issues.jboss.org/browse/WFCORE-2288
Project: WildFly Core
Issue Type: Bug
Components: Domain Management
Affects Versions: 3.0.0.Alpha24
Reporter: Paul Ferraro
Assignee: Brian Stansberry
This is due to the following logic in AbstractAddStepHandler:
{noformat}
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);
}
{noformat}
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.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)