Skip to content

Commit

Permalink
Merge pull request #5413 from pferraro/WFCORE-6221
Browse files Browse the repository at this point in the history
WFCORE-6221 Add formal experimental/preview mode to management model
  • Loading branch information
bstansberry authored Dec 9, 2023
2 parents 91ff9e3 + b20d4c0 commit 2ae1c3c
Show file tree
Hide file tree
Showing 13 changed files with 153 additions and 124 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ static EmbedHostControllerHandler create(final AtomicReference<EmbeddedProcessLa
result.removeExistingDomainConfig = new ArgumentWithoutValue(result, REMOVE_EXISTING_DOMAIN_CONFIG);
result.emptyHostConfig = new ArgumentWithoutValue(result, EMPTY_HOST_CONFIG);
result.removeExistingHostConfig = new ArgumentWithoutValue(result, REMOVE_EXISTING_HOST_CONFIG);
// TODO: Use ProductConfig.getStabilitySet()
result.stability = new ArgumentWithValue(result, new SimpleTabCompleter(EnumSet.allOf(Stability.class)), "--stability");
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ static EmbedServerHandler create(final AtomicReference<EmbeddedProcessLaunch> se
result.removeExisting = new ArgumentWithoutValue(result, "--remove-existing");
result.removeExisting.addRequiredPreceding(result.emptyConfig);
result.timeout = new ArgumentWithValue(result, "--timeout");
// TODO: Use ProductConfig.getStabilitySet()
result.stability = new ArgumentWithValue(result, new SimpleTabCompleter(EnumSet.allOf(Stability.class)), "--stability");

return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ public interface ManagementResourceRegistration extends ImmutableManagementResou
*
* @param resourceDefinition source for descriptive information describing this
* portion of the model (must not be {@code null})
* @return a resource registration which may be used to add attributes, operations, notifications and sub-models
* @return a resource registration which may be used to add attributes, operations, notifications and sub-models,
* or null, if this resource definition is not enabled by the current stability level.
*
* @throws IllegalArgumentException if a submodel is already registered at {@code address}
* @throws IllegalStateException if {@link #isRuntimeOnly()} returns {@code true}
Expand Down Expand Up @@ -103,7 +104,7 @@ public interface ManagementResourceRegistration extends ImmutableManagementResou
* @param name the specific name of the resource. Cannot be {@code null} or {@link PathElement#WILDCARD_VALUE}
* @param descriptionProvider provider for descriptions of the additional attributes or child types
*
* @return a resource registration which may be used to add attributes, operations and sub-models
* @return a resource registration which may be used to add attributes, operations and sub-models.
*
* @throws IllegalArgumentException if either parameter is null or if there is already a registration under {@code name}
* @throws IllegalStateException if {@link #isRuntimeOnly()} returns {@code true} or if {@link #isAllowsOverride()} returns false
Expand All @@ -118,7 +119,8 @@ public interface ManagementResourceRegistration extends ImmutableManagementResou
* @param registration the child registration of this registry that should no longer be available
* @param descriptionProvider provider for descriptions of the additional attributes or child types
*
* @return a resource registration which may be used to add attributes, operations and sub-models
* @return a resource registration which may be used to add attributes, operations and sub-models,
* or null, if this resource definition is not enabled by the current stability level.
*
* @throws IllegalArgumentException if either parameter is null or if there is already a registration under {@code name}
* @throws IllegalStateException if {@link #isRuntimeOnly()} returns {@code true} or if {@link #isAllowsOverride()} returns false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ public HostControllerEnvironment(Map<String, String> hostSystemProperties, boole
this.processType = processType;

this.stability = getEnumProperty(hostSystemProperties, STABILITY, this.productConfig.getDefaultStability());
if (!this.productConfig.getMinimumStability().enables(this.stability)) {
if (!this.productConfig.getStabilitySet().contains(this.stability)) {
throw HostControllerLogger.ROOT_LOGGER.unsupportedStability(this.stability, this.productConfig.getProductName());
}
if (!hostSystemProperties.containsKey(STABILITY)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

package org.jboss.as.host.controller;

import org.jboss.as.version.ProductConfig;

/**
* @author wangc
*
Expand All @@ -18,18 +20,20 @@ enum HostControllerEnvironmentStatus {

private HostControllerEnvironment hostControllerEnvironment;
private HostControllerEnvironmentStatus hostControllerEnvironmentStatus;
private ProductConfig productConfig;

private HostControllerEnvironmentWrapper(HostControllerEnvironment hostControllerEnvironment, HostControllerEnvironmentStatus hostControllerEnvironmentStatus) {
private HostControllerEnvironmentWrapper(HostControllerEnvironment hostControllerEnvironment, HostControllerEnvironmentStatus hostControllerEnvironmentStatus, ProductConfig productConfig) {
this.hostControllerEnvironment = hostControllerEnvironment;
this.hostControllerEnvironmentStatus = hostControllerEnvironmentStatus;
this.productConfig = productConfig;
}

HostControllerEnvironmentWrapper(HostControllerEnvironment hostControllerEnvironment) {
this(hostControllerEnvironment, null);
this(hostControllerEnvironment, null, hostControllerEnvironment.getProductConfig());
}

HostControllerEnvironmentWrapper(HostControllerEnvironmentStatus hostControllerEnvironmentStatus) {
this(null, hostControllerEnvironmentStatus);
HostControllerEnvironmentWrapper(HostControllerEnvironmentStatus hostControllerEnvironmentStatus, ProductConfig productConfig) {
this(null, hostControllerEnvironmentStatus, productConfig);
}

public HostControllerEnvironment getHostControllerEnvironment() {
Expand All @@ -39,4 +43,8 @@ public HostControllerEnvironment getHostControllerEnvironment() {
public HostControllerEnvironmentStatus getHostControllerEnvironmentStatus() {
return hostControllerEnvironmentStatus;
}

public ProductConfig getProductConfig() {
return this.productConfig;
}
}
Loading

0 comments on commit 2ae1c3c

Please sign in to comment.