From 3be5b14631be1cbfa9a170ade4120a6f2946f697 Mon Sep 17 00:00:00 2001 From: Parul Sharma Date: Thu, 13 Jul 2023 12:56:25 +0530 Subject: [PATCH] WFCORE-6321 Declare the capability in ServerService.java --- .../org/jboss/as/server/ServerEnvironmentService.java | 9 +++------ .../src/main/java/org/jboss/as/server/ServerService.java | 4 +++- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/server/src/main/java/org/jboss/as/server/ServerEnvironmentService.java b/server/src/main/java/org/jboss/as/server/ServerEnvironmentService.java index f34b547529b..d1b6d5208f5 100644 --- a/server/src/main/java/org/jboss/as/server/ServerEnvironmentService.java +++ b/server/src/main/java/org/jboss/as/server/ServerEnvironmentService.java @@ -22,7 +22,6 @@ package org.jboss.as.server; -import org.jboss.as.controller.capability.RuntimeCapability; import org.jboss.msc.service.Service; import org.jboss.msc.service.ServiceName; import org.jboss.msc.service.ServiceTarget; @@ -30,6 +29,8 @@ import org.jboss.msc.service.StartException; import org.jboss.msc.service.StopContext; +import static org.jboss.as.server.ServerService.SERVER_ENVIRONMENT_CAPABILITY; + /** * Exposes the {@link ServerEnvironment} via a {@link Service}. *

@@ -71,11 +72,7 @@ public static void addService(ServerEnvironment serverEnvironment, ServiceTarget target.addService(SERVER_ENVIRONMENT_CAPABILITY.getCapabilityServiceName(), new ServerEnvironmentService(serverEnvironment)) .install(); } - - private static final String SERVER_ENVIRONMENT_SERVICE_NAME = "jboss.server.environment"; - public static final RuntimeCapability SERVER_ENVIRONMENT_CAPABILITY = RuntimeCapability.Builder.of(SERVER_ENVIRONMENT_SERVICE_NAME, ServerEnvironment.class).build(); - - private final ServerEnvironment serverEnvironment; + private final ServerEnvironment serverEnvironment; /** * Creates a ServerEnvironmentService that uses the given {@code serverEnvironment} diff --git a/server/src/main/java/org/jboss/as/server/ServerService.java b/server/src/main/java/org/jboss/as/server/ServerService.java index fa06b333d19..faa8d484d4a 100644 --- a/server/src/main/java/org/jboss/as/server/ServerService.java +++ b/server/src/main/java/org/jboss/as/server/ServerService.java @@ -28,7 +28,6 @@ import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.MANAGEMENT_OPERATIONS; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SERVICE; import static org.jboss.as.domain.http.server.ConsoleAvailability.CONSOLE_AVAILABILITY_CAPABILITY; -import static org.jboss.as.server.ServerEnvironmentService.SERVER_ENVIRONMENT_CAPABILITY; import java.io.File; import java.security.PrivilegedAction; @@ -179,6 +178,7 @@ public final class ServerService extends AbstractControllerService { static final String SUSPEND_CONTROLLER_CAPABILITY_NAME = "org.wildfly.server.suspend-controller"; static final String EXTERNAL_MODULE_CAPABILITY_NAME = "org.wildfly.management.external-module"; + static final String SERVER_ENVIRONMENT_SERVICE_NAME = "org.wildfly.server.environment"; static final RuntimeCapability SUSPEND_CONTROLLER_CAPABILITY = RuntimeCapability.Builder.of(SUSPEND_CONTROLLER_CAPABILITY_NAME, SuspendController.class) @@ -187,6 +187,8 @@ public final class ServerService extends AbstractControllerService { static final RuntimeCapability EXTERNAL_MODULE_CAPABILITY = RuntimeCapability.Builder.of(EXTERNAL_MODULE_CAPABILITY_NAME, ExternalModule.class) .build(); + static final RuntimeCapability SERVER_ENVIRONMENT_CAPABILITY = RuntimeCapability.Builder.of(SERVER_ENVIRONMENT_SERVICE_NAME, ServerEnvironment.class).build(); + /** * Construct a new instance.