Skip to content

Commit

Permalink
WFCORE-6407 Remove use of deprecated AbstractAddStepHandler construct…
Browse files Browse the repository at this point in the history
…or in discovery subsystem. Use static OperationStepHandler instances wherever possible.
  • Loading branch information
pferraro committed Jun 25, 2023
1 parent 6937832 commit 80e55fc
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@
*/
class AggregateDiscoveryProviderAddHandler extends AbstractAddStepHandler {

AggregateDiscoveryProviderAddHandler() {
super(new Parameters().addAttribute(AggregateDiscoveryProviderDefinition.PROVIDER_NAMES));
}

@Override
protected void performRuntime(OperationContext context, ModelNode operation, Resource resource) throws OperationFailedException {
ServiceName name = DiscoveryExtension.DISCOVERY_PROVIDER_CAPABILITY.getCapabilityServiceName(context.getCurrentAddress());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@ final class AggregateDiscoveryProviderDefinition extends SimpleResourceDefinitio

@Override
public void registerAttributes(final ManagementResourceRegistration resourceRegistration) {
resourceRegistration.registerReadWriteAttribute(PROVIDER_NAMES, null, new ReloadRequiredWriteAttributeHandler(PROVIDER_NAMES));
resourceRegistration.registerReadWriteAttribute(PROVIDER_NAMES, null, ReloadRequiredWriteAttributeHandler.INSTANCE);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ static TransformationDescription buildTransformers(ModelVersion version) {

DiscoverySubsystemDefinition() {
super(new Parameters(PATH, DiscoveryExtension.SUBSYSTEM_RESOLVER)
.setAddHandler(new ModelOnlyAddStepHandler())
.setAddHandler(ModelOnlyAddStepHandler.INSTANCE)
.setRemoveHandler(ReloadRequiredRemoveStepHandler.INSTANCE)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@
*/
class StaticDiscoveryProviderAddHandler extends AbstractAddStepHandler {

StaticDiscoveryProviderAddHandler() {
super(new Parameters().addAttribute(StaticDiscoveryProviderDefinition.SERVICES));
}

@Override
protected void performRuntime(OperationContext context, ModelNode operation, Resource resource) throws OperationFailedException {
List<ModelNode> services = StaticDiscoveryProviderDefinition.SERVICES.resolveModelAttribute(context, resource.getModel()).asListOrEmpty();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,6 @@ final class StaticDiscoveryProviderDefinition extends SimpleResourceDefinition {

@Override
public void registerAttributes(final ManagementResourceRegistration resourceRegistration) {
resourceRegistration.registerReadWriteAttribute(SERVICES, null, new ReloadRequiredWriteAttributeHandler(SERVICES));
resourceRegistration.registerReadWriteAttribute(SERVICES, null, ReloadRequiredWriteAttributeHandler.INSTANCE);
}
}

0 comments on commit 80e55fc

Please sign in to comment.