Skip to content

Commit

Permalink
Merge pull request #5989 from pferraro/WFCORE-6816
Browse files Browse the repository at this point in the history
WFCORE-6816 A resource with a deployment chain contributor should require restarting all services on removal
  • Loading branch information
yersan authored May 13, 2024
2 parents f990514 + 35c0263 commit cee7969
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,7 @@ abstract static class AbstractConfigurator<C extends Configurator<C>> implements
static final BiPredicate<OperationContext, Resource> DEFAULT_CAPABILITY_FILTER = (context, resource) -> resource.getModel().isDefined();

private static final Set<OperationEntry.Flag> RESTART_FLAGS = EnumSet.of(OperationEntry.Flag.RESTART_ALL_SERVICES, OperationEntry.Flag.RESTART_JVM, OperationEntry.Flag.RESTART_NONE, OperationEntry.Flag.RESTART_RESOURCE_SERVICES);
private static final Set<OperationEntry.Flag> RELOAD_RESTART_FLAGS = EnumSet.of(OperationEntry.Flag.RESTART_ALL_SERVICES, OperationEntry.Flag.RESTART_JVM);

private final ResourceDescriptionResolver descriptionResolver;
private Optional<ResourceOperationRuntimeHandler> runtimeHandler = Optional.empty();
Expand Down Expand Up @@ -664,9 +665,13 @@ public C withResourceTransformation(UnaryOperator<Resource> transformation) {
@Override
public C withDeploymentChainContributor(Consumer<DeploymentProcessorTarget> contributor) {
this.deploymentChainContributor = Optional.of(contributor);
if (this.addOperationRestartFlag == OperationEntry.Flag.RESTART_NONE) {
// If this resource contributes to the deployment chain, adding or removing it requires a reload
if (!RELOAD_RESTART_FLAGS.contains(this.addOperationRestartFlag)) {
this.addOperationRestartFlag = OperationEntry.Flag.RESTART_ALL_SERVICES;
}
if (!RELOAD_RESTART_FLAGS.contains(this.removeOperationRestartFlag)) {
this.removeOperationRestartFlag = OperationEntry.Flag.RESTART_ALL_SERVICES;
}
return this.self();
}

Expand Down

0 comments on commit cee7969

Please sign in to comment.