Skip to content

Commit

Permalink
Merge branch 'main' into WFCORE-7094
Browse files Browse the repository at this point in the history
  • Loading branch information
yersan authored Dec 17, 2024
2 parents cf98626 + 19240ed commit a3991b3
Show file tree
Hide file tree
Showing 119 changed files with 646 additions and 213 deletions.
2 changes: 1 addition & 1 deletion bootable-jar/boot/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>org.wildfly.core</groupId>
<artifactId>wildfly-jar-parent</artifactId>
<version>27.0.0.Beta6-SNAPSHOT</version>
<version>27.0.0.Final-SNAPSHOT</version>
</parent>

<artifactId>wildfly-jar-boot</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bootable-jar/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<parent>
<groupId>org.wildfly.core</groupId>
<artifactId>wildfly-core-parent</artifactId>
<version>27.0.0.Beta6-SNAPSHOT</version>
<version>27.0.0.Final-SNAPSHOT</version>
</parent>

<artifactId>wildfly-jar-parent</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bootable-jar/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>org.wildfly.core</groupId>
<artifactId>wildfly-jar-parent</artifactId>
<version>27.0.0.Beta6-SNAPSHOT</version>
<version>27.0.0.Final-SNAPSHOT</version>
</parent>

<artifactId>wildfly-jar-runtime</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion build/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<parent>
<groupId>org.wildfly.core</groupId>
<artifactId>wildfly-core-parent</artifactId>
<version>27.0.0.Beta6-SNAPSHOT</version>
<version>27.0.0.Final-SNAPSHOT</version>
</parent>

<artifactId>wildfly-core-build</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<parent>
<groupId>org.wildfly.core</groupId>
<artifactId>wildfly-core-parent</artifactId>
<version>27.0.0.Beta6-SNAPSHOT</version>
<version>27.0.0.Final-SNAPSHOT</version>
</parent>

<artifactId>wildfly-cli</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion component-matrix-builder/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
Maintain separation between the artifact id and the version to help prevent
merge conflicts between commits changing the GA and those changing the V.
-->
<version>27.0.0.Beta6-SNAPSHOT</version>
<version>27.0.0.Final-SNAPSHOT</version>
</parent>

<groupId>org.wildfly.core</groupId>
Expand Down
2 changes: 1 addition & 1 deletion controller-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<parent>
<groupId>org.wildfly.core</groupId>
<artifactId>wildfly-core-parent</artifactId>
<version>27.0.0.Beta6-SNAPSHOT</version>
<version>27.0.0.Final-SNAPSHOT</version>
</parent>

<artifactId>wildfly-controller-client</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion controller/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<parent>
<groupId>org.wildfly.core</groupId>
<artifactId>wildfly-core-parent</artifactId>
<version>27.0.0.Beta6-SNAPSHOT</version>
<version>27.0.0.Final-SNAPSHOT</version>
</parent>

<artifactId>wildfly-controller</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1242,6 +1242,7 @@ public final void reloadRequired() {
@Override
public final void restartRequired() {
if (isBooting()) {
MGMT_OP_LOGGER.debug("Server is booting so we didn't set the restart required flag");
return;
}
activeStep.setRestartStamp(processState.setRestartRequired());
Expand Down
2 changes: 1 addition & 1 deletion core-feature-pack/channel/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<parent>
<groupId>org.wildfly.core</groupId>
<artifactId>wildfly-core-feature-pack-parent</artifactId>
<version>27.0.0.Beta6-SNAPSHOT</version>
<version>27.0.0.Final-SNAPSHOT</version>
</parent>

<artifactId>wildfly-core-channel</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion core-feature-pack/common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<parent>
<groupId>org.wildfly.core</groupId>
<artifactId>wildfly-core-feature-pack-parent</artifactId>
<version>27.0.0.Beta6-SNAPSHOT</version>
<version>27.0.0.Final-SNAPSHOT</version>
</parent>

<artifactId>wildfly-core-feature-pack-common</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
<artifact name="${org.wildfly.security:wildfly-elytron-credential-source-impl}"/>
<artifact name="${org.wildfly.security:wildfly-elytron-credential-store}"/>
<artifact name="${org.wildfly.security:wildfly-elytron-digest}"/>
<artifact name="${org.wildfly.security:wildfly-elytron-dynamic-ssl}"/>
<artifact name="${org.wildfly.security:wildfly-elytron-encryption}"/>
<artifact name="${org.wildfly.security:wildfly-elytron-http}"/>
<artifact name="${org.wildfly.security:wildfly-elytron-http-basic}"/>
Expand Down Expand Up @@ -112,5 +111,6 @@
modules use the parser, they need to have visibility to this module.
-->
<module name="org.wildfly.client.config" export="true"/>
<module name="org.wildfly.security.elytron-dynamic-ssl" export="true" optional="true"/>
</dependencies>
</module>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
~ Copyright The WildFly Authors
~ SPDX-License-Identifier: Apache-2.0
-->
<module xmlns="urn:jboss:module:1.9" name="org.wildfly.security.elytron-dynamic-ssl">

<properties>
<property name="jboss.api" value="private"/>
<property name="jboss.stability" value="community"/>
</properties>

<resources>
<artifact name="${org.wildfly.security:wildfly-elytron-dynamic-ssl}"/>
</resources>

<dependencies>
<module name="java.logging"/>
<module name="org.jboss.logging" />
<module name="org.jboss.logmanager" />
<module name="org.wildfly.security.elytron-base"/>
<module name="org.wildfly.common"/>
<module name="org.wildfly.client.config"/>
</dependencies>
</module>
2 changes: 1 addition & 1 deletion core-feature-pack/ee-10-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<parent>
<groupId>org.wildfly.core</groupId>
<artifactId>wildfly-core-feature-pack-parent</artifactId>
<version>27.0.0.Beta6-SNAPSHOT</version>
<version>27.0.0.Final-SNAPSHOT</version>
</parent>

<artifactId>wildfly-core-feature-pack-ee-10-api</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion core-feature-pack/galleon-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<parent>
<groupId>org.wildfly.core</groupId>
<artifactId>wildfly-core-feature-pack-parent</artifactId>
<version>27.0.0.Beta6-SNAPSHOT</version>
<version>27.0.0.Final-SNAPSHOT</version>
</parent>

<artifactId>wildfly-core-feature-pack-galleon-common</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,9 @@
<!-- required by default configuration-->
<package name="org.wildfly.extension.elytron.jaas-realm"/>
<package name="org.wildfly.openssl"/>
<!-- In case the feature-pack containing this package is constrained at build time
to a level that doesn't imply 'community', this package will be not packaged inside the feature-pack.
'valid-for-stability' attribute allows to keep this dependency that will be ignored at provisioning time. -->
<package name="org.wildfly.security.elytron-dynamic-ssl" optional="true" valid-for-stability="community"/>
</packages>
</layer-spec>
2 changes: 1 addition & 1 deletion core-feature-pack/galleon-feature-pack/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<parent>
<groupId>org.wildfly.core</groupId>
<artifactId>wildfly-core-feature-pack-parent</artifactId>
<version>27.0.0.Beta6-SNAPSHOT</version>
<version>27.0.0.Final-SNAPSHOT</version>
</parent>

<artifactId>wildfly-core-galleon-pack</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion core-feature-pack/manifest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<parent>
<groupId>org.wildfly.core</groupId>
<artifactId>wildfly-core-feature-pack-parent</artifactId>
<version>27.0.0.Beta6-SNAPSHOT</version>
<version>27.0.0.Final-SNAPSHOT</version>
</parent>

<artifactId>wildfly-core-manifest</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion core-feature-pack/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<parent>
<groupId>org.wildfly.core</groupId>
<artifactId>wildfly-core-parent</artifactId>
<version>27.0.0.Beta6-SNAPSHOT</version>
<version>27.0.0.Final-SNAPSHOT</version>
</parent>

<artifactId>wildfly-core-feature-pack-parent</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion core-management/core-management-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<parent>
<groupId>org.wildfly.core</groupId>
<artifactId>wildfly-core-management</artifactId>
<version>27.0.0.Beta6-SNAPSHOT</version>
<version>27.0.0.Final-SNAPSHOT</version>
</parent>

<artifactId>wildfly-core-management-client</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion core-management/core-management-subsystem/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<parent>
<groupId>org.wildfly.core</groupId>
<artifactId>wildfly-core-management</artifactId>
<version>27.0.0.Beta6-SNAPSHOT</version>
<version>27.0.0.Final-SNAPSHOT</version>
</parent>

<artifactId>wildfly-core-management-subsystem</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion core-management/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<parent>
<groupId>org.wildfly.core</groupId>
<artifactId>wildfly-core-parent</artifactId>
<version>27.0.0.Beta6-SNAPSHOT</version>
<version>27.0.0.Final-SNAPSHOT</version>
</parent>

<artifactId>wildfly-core-management</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion core-model-test/framework/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<parent>
<groupId>org.wildfly.core</groupId>
<artifactId>wildfly-core-model-test</artifactId>
<version>27.0.0.Beta6-SNAPSHOT</version>
<version>27.0.0.Final-SNAPSHOT</version>
</parent>

<artifactId>wildfly-core-model-test-framework</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.jboss.as.host.controller.HostRunningModeControl;
import org.jboss.as.host.controller.RestartMode;
import org.jboss.as.model.test.ModelTestOperationValidatorFilter;
import org.jboss.as.version.Stability;
import org.jboss.dmr.ModelNode;
import org.jboss.staxmapper.XMLMapper;

Expand All @@ -54,6 +55,28 @@ public static KernelServices create(List<ModelNode> bootOperations, ModelTestOpe
return AbstractKernelServicesImpl.create(ProcessType.HOST_CONTROLLER, runningModeControl, validateOpsFilter, bootOperations, testParser, legacyModelVersion, type, modelInitializer, extensionRegistry, null);
}

public static KernelServices create(List<ModelNode> bootOperations, ModelTestOperationValidatorFilter validateOpsFilter, ModelVersion legacyModelVersion,
List<LegacyModelInitializerEntry> modelInitializerEntries, String stabilityStr) throws Exception {

Stability stability = Stability.fromString(stabilityStr);
TestModelType type = TestModelType.DOMAIN;
XMLMapper xmlMapper = XMLMapper.Factory.create();
TestParser testParser = TestParser.create(stability, null, xmlMapper, type);
ModelInitializer modelInitializer = null;
if (modelInitializerEntries != null && !modelInitializerEntries.isEmpty()) {
modelInitializer = new LegacyModelInitializer(modelInitializerEntries);
}

RunningModeControl runningModeControl = new HostRunningModeControl(RunningMode.ADMIN_ONLY, RestartMode.HC_ONLY);

ExtensionRegistry extensionRegistry = ExtensionRegistry.builder(ProcessType.HOST_CONTROLLER)
.withRunningMode(runningModeControl.getRunningMode())
.withStability(stability)
.build();

return AbstractKernelServicesImpl.create(ProcessType.HOST_CONTROLLER, runningModeControl, validateOpsFilter, bootOperations, testParser, legacyModelVersion, type, modelInitializer, extensionRegistry, null);
}

private static class LegacyModelInitializer implements ModelInitializer {

private final List<LegacyModelInitializerEntry> entries;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,58 +14,89 @@
import org.jboss.as.core.model.bridge.impl.LegacyControllerKernelServicesProxy;
import org.jboss.as.core.model.test.LegacyModelInitializerEntry;
import org.jboss.as.model.test.ModelTestOperationValidatorFilter;
import org.jboss.as.version.Stability;
import org.jboss.dmr.ModelNode;

/**
*
* @author <a href="[email protected]">Kabir Khan</a>
*/
public class ScopedKernelServicesBootstrap {
Stability stability;
ClassLoader legacyChildFirstClassLoader;
ClassLoaderObjectConverter objectConverter;

public ScopedKernelServicesBootstrap(ClassLoader legacyChildFirstClassLoader) {
public ScopedKernelServicesBootstrap(ClassLoader legacyChildFirstClassLoader, Stability stability) {
this.legacyChildFirstClassLoader = legacyChildFirstClassLoader;
this.objectConverter = new ClassLoaderObjectConverterImpl(this.getClass().getClassLoader(), legacyChildFirstClassLoader);
this.stability = stability;
}


public LegacyControllerKernelServicesProxy createKernelServices(List<ModelNode> bootOperations, ModelTestOperationValidatorFilter validateOpsFilter, ModelVersion legacyModelVersion, List<LegacyModelInitializerEntry> modelInitializerEntries) throws Exception {

Object childClassLoaderKernelServices = createChildClassLoaderKernelServices(bootOperations, validateOpsFilter, legacyModelVersion, modelInitializerEntries);
return new LegacyControllerKernelServicesProxy(legacyChildFirstClassLoader, childClassLoaderKernelServices, objectConverter);
}

private Object createChildClassLoaderKernelServices(List<ModelNode> bootOperations, ModelTestOperationValidatorFilter validateOpsFilter, ModelVersion legacyModelVersion, List<LegacyModelInitializerEntry> modelInitializerEntries){
private Object createChildClassLoaderKernelServices(List<ModelNode> bootOperations, ModelTestOperationValidatorFilter validateOpsFilter, ModelVersion legacyModelVersion, List<LegacyModelInitializerEntry> modelInitializerEntries) {
try {
Class<?> clazz = legacyChildFirstClassLoader.loadClass(ChildFirstClassLoaderKernelServicesFactory.class.getName());
List<Object> convertedBootOps = getConvertedBootOps(bootOperations);
List<Object> convertedModelInitializerEntries = convertModelInitializer(modelInitializerEntries);

Method m = clazz.getMethod("create",
List.class,
legacyChildFirstClassLoader.loadClass(ModelTestOperationValidatorFilter.class.getName()),
legacyChildFirstClassLoader.loadClass(ModelVersion.class.getName()),
List.class);

List<Object> convertedBootOps = new ArrayList<Object>();
for (int i = 0 ; i < bootOperations.size() ; i++) {
ModelNode node = bootOperations.get(i);
if (node != null) {
convertedBootOps.add(objectConverter.convertModelNodeToChildCl(node));
}
}
Object convertedValidationFilter = objectConverter.convertValidateOperationsFilterToChildCl(validateOpsFilter);
Object convertedLegacyModelVersion = objectConverter.convertModelVersionToChildCl(legacyModelVersion);

List<Object> convertedModelInitializerEntries = null;
if (modelInitializerEntries != null) {
convertedModelInitializerEntries = new ArrayList<Object>();
for (LegacyModelInitializerEntry entry : modelInitializerEntries) {
convertedModelInitializerEntries.add(objectConverter.convertLegacyModelInitializerEntryToChildCl(entry));
}
}
if (!Stability.DEFAULT.equals(stability)) {
Method m = clazz.getMethod("create",
List.class,
legacyChildFirstClassLoader.loadClass(ModelTestOperationValidatorFilter.class.getName()),
legacyChildFirstClassLoader.loadClass(ModelVersion.class.getName()),
List.class,
String.class);

return m.invoke(null, convertedBootOps, objectConverter.convertValidateOperationsFilterToChildCl(validateOpsFilter), objectConverter.convertModelVersionToChildCl(legacyModelVersion), convertedModelInitializerEntries);
return m.invoke(null,
convertedBootOps,
convertedValidationFilter,
convertedLegacyModelVersion,
convertedModelInitializerEntries,
stability.toString());
} else {
Method m = clazz.getMethod("create",
List.class,
legacyChildFirstClassLoader.loadClass(ModelTestOperationValidatorFilter.class.getName()),
legacyChildFirstClassLoader.loadClass(ModelVersion.class.getName()),
List.class);

return m.invoke(null,
convertedBootOps,
convertedValidationFilter,
convertedLegacyModelVersion,
convertedModelInitializerEntries);
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}

private List<Object> convertModelInitializer(List<LegacyModelInitializerEntry> modelInitializerEntries) {
List<Object> converted = null;
if (modelInitializerEntries != null) {
converted = new ArrayList<>();
for (LegacyModelInitializerEntry entry : modelInitializerEntries) {
converted.add(objectConverter.convertLegacyModelInitializerEntryToChildCl(entry));
}
}
return converted;
}

private List<Object> getConvertedBootOps(List<ModelNode> bootOperations) {
List<Object> converted = new ArrayList<>();
for (ModelNode node : bootOperations) {
if (node != null) {
converted.add(objectConverter.convertModelNodeToChildCl(node));
}
}
return converted;
}
}

Loading

0 comments on commit a3991b3

Please sign in to comment.