Skip to content

Commit

Permalink
Merge pull request wildfly#6047 from pferraro/WFCORE-6865
Browse files Browse the repository at this point in the history
WFCORE-6865 DefaultResourceAddDescriptionProvider omits the stability of the operation from its generated description
  • Loading branch information
bstansberry authored Jun 25, 2024
2 parents b9ffd51 + 63e94d4 commit 98d3c35
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ protected void registerAddOperation(final ManagementResourceRegistration registr
.setParameters(this.getAddOperationParameters(registration))
.setDescriptionProvider(descriptionProvider)
.setEntryType(OperationEntry.EntryType.PUBLIC)
.setStability(registration.getStability())
.withFlags(flags)
.build();
registration.registerOperationHandler(definition, handler);
Expand All @@ -234,6 +235,7 @@ protected void registerRemoveOperation(final ManagementResourceRegistration regi
OperationDefinition definition = new SimpleOperationDefinitionBuilder(ModelDescriptionConstants.REMOVE, this.descriptionResolver)
.setDescriptionProvider(descriptionProvider)
.setEntryType(OperationEntry.EntryType.PUBLIC)
.setStability(registration.getStability())
.withFlags(flags)
.build();
registration.registerOperationHandler(definition, handler);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OPERATION_NAME;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.REPLY_PROPERTIES;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.REQUEST_PROPERTIES;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.STABILITY;

import java.util.Locale;
import java.util.Map;
Expand Down Expand Up @@ -92,7 +93,8 @@ public ModelNode getModelDescription(Locale locale) {
//This is auto-generated so don't add any access constraints

result.get(REPLY_PROPERTIES).setEmptyObject();

// Use the stability level of the resource
result.get(STABILITY).set(this.registration.getStability().toString());

return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,15 @@ public void register(ManagementResourceRegistration registration) {
OperationDefinition addDefinition = new SimpleOperationDefinitionBuilder(ModelDescriptionConstants.ADD, this.descriptor.getResourceDescriptionResolver())
.setParameters(attributes.toArray(AttributeDefinition[]::new))
.setDescriptionProvider(new DefaultResourceAddDescriptionProvider(registration, this.descriptor.getResourceDescriptionResolver(), ordered))
.setStability(registration.getStability())
.withFlag(this.descriptor.getAddOperationRestartFlag())
.build();
registration.registerOperationHandler(addDefinition, this.descriptor.getAddOperationTransformation().apply(new AddResourceOperationStepHandler(this.descriptor)));

// Register remove resource operation handler
OperationDefinition removeDefinition = new SimpleOperationDefinitionBuilder(ModelDescriptionConstants.REMOVE, this.descriptor.getResourceDescriptionResolver())
.setDescriptionProvider(new DefaultResourceRemoveDescriptionProvider(this.descriptor.getResourceDescriptionResolver()))
.setStability(registration.getStability())
.withFlag(this.descriptor.getRemoveOperationRestartFlag())
.build();
registration.registerOperationHandler(removeDefinition, this.descriptor.getResourceOperationTransformation().apply(new RemoveResourceOperationStepHandler(this.descriptor)));
Expand Down

0 comments on commit 98d3c35

Please sign in to comment.