From 631398f66efef2bc800d07faadf8c9016db2045c Mon Sep 17 00:00:00 2001 From: Paul Ferraro Date: Wed, 17 Jul 2024 18:05:09 -0400 Subject: [PATCH] Anticipate WFCORE-6894 --- .../java/org/wildfly/extension/health/ServerProbes.java | 4 ++-- .../undertow/UndertowEventHandlerAdapterService.java | 6 +++--- .../wildfly/extension/undertow/RuntimeInitialization.java | 3 ++- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/health/src/main/java/org/wildfly/extension/health/ServerProbes.java b/health/src/main/java/org/wildfly/extension/health/ServerProbes.java index f388523af9d4..bc46ef2223f2 100644 --- a/health/src/main/java/org/wildfly/extension/health/ServerProbes.java +++ b/health/src/main/java/org/wildfly/extension/health/ServerProbes.java @@ -20,12 +20,12 @@ import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SUCCESS; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SUSPEND_STATE; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.VALUE; -import static org.jboss.as.server.suspend.SuspendController.State.RUNNING; import java.util.List; import org.jboss.as.controller.LocalModelControllerClient; import org.jboss.as.controller.PathAddress; +import org.jboss.as.server.suspend.SuspendController; import org.jboss.dmr.ModelNode; class ServerProbes { @@ -125,7 +125,7 @@ public Outcome getOutcome() { String value = result.asString(); ModelNode data = new ModelNode(); data.add(VALUE, value); - return new Outcome(RUNNING.toString().equals(value), data); + return new Outcome(SuspendController.State.RUNNING.toString().equals(value), data); } @Override diff --git a/mod_cluster/undertow/src/main/java/org/wildfly/mod_cluster/undertow/UndertowEventHandlerAdapterService.java b/mod_cluster/undertow/src/main/java/org/wildfly/mod_cluster/undertow/UndertowEventHandlerAdapterService.java index 3caa02d64f73..5aef64db7e50 100644 --- a/mod_cluster/undertow/src/main/java/org/wildfly/mod_cluster/undertow/UndertowEventHandlerAdapterService.java +++ b/mod_cluster/undertow/src/main/java/org/wildfly/mod_cluster/undertow/UndertowEventHandlerAdapterService.java @@ -14,7 +14,7 @@ import org.jboss.as.server.suspend.ServerActivity; import org.jboss.as.server.suspend.ServerActivityCallback; -import org.jboss.as.server.suspend.SuspendController.State; +import org.jboss.as.server.suspend.SuspendController; import org.jboss.logging.Logger; import org.jboss.modcluster.container.Connector; import org.jboss.modcluster.container.ContainerEventHandler; @@ -105,9 +105,9 @@ private Context createContext(String contextPath, Host host) { private synchronized void onStart(Context context) { ContainerEventHandler handler = this.configuration.getContainerEventHandler(); - State state = this.configuration.getSuspendController().getState(); + SuspendController.State state = this.configuration.getSuspendController().getState(); - if (state == State.RUNNING) { + if (state == SuspendController.State.RUNNING) { // Normal operation - trigger ENABLE-APP handler.start(context); } else { diff --git a/undertow/src/test/java/org/wildfly/extension/undertow/RuntimeInitialization.java b/undertow/src/test/java/org/wildfly/extension/undertow/RuntimeInitialization.java index b7a2a8e8db05..97df983c9ee0 100644 --- a/undertow/src/test/java/org/wildfly/extension/undertow/RuntimeInitialization.java +++ b/undertow/src/test/java/org/wildfly/extension/undertow/RuntimeInitialization.java @@ -88,7 +88,8 @@ protected void addExtraServices(ServiceTarget target) { try { SSLContext sslContext = SSLContext.getDefault(); - target.addService(ServiceName.parse(Capabilities.REF_SUSPEND_CONTROLLER)).setInstance(new SuspendController()).install(); + ServiceBuilder builder = target.addService(); + builder.setInstance(Service.newInstance(builder.provides(ServiceName.parse(Capabilities.REF_SUSPEND_CONTROLLER)), new SuspendController())).install(); target.addService(Services.JBOSS_SERVICE_MODULE_LOADER).setInstance(new ServiceModuleLoader(null)).install(); target.addService(ContextNames.JAVA_CONTEXT_SERVICE_NAME).setInstance(new NamingStoreService()).install(); target.addService(ContextNames.JBOSS_CONTEXT_SERVICE_NAME).setInstance(new NamingStoreService()).install();