Skip to content

Commit

Permalink
WFCORE-6321 Declare the capability in ServerService.java
Browse files Browse the repository at this point in the history
  • Loading branch information
parsharma committed Jul 13, 2023
1 parent 6fd01cf commit 3be5b14
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@

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;
import org.jboss.msc.service.StartContext;
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}.
* <p>
Expand Down Expand Up @@ -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<Void> 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}
Expand Down
4 changes: 3 additions & 1 deletion server/src/main/java/org/jboss/as/server/ServerService.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<Void> SUSPEND_CONTROLLER_CAPABILITY =
RuntimeCapability.Builder.of(SUSPEND_CONTROLLER_CAPABILITY_NAME, SuspendController.class)
Expand All @@ -187,6 +187,8 @@ public final class ServerService extends AbstractControllerService {
static final RuntimeCapability<Void> EXTERNAL_MODULE_CAPABILITY =
RuntimeCapability.Builder.of(EXTERNAL_MODULE_CAPABILITY_NAME, ExternalModule.class)
.build();
static final RuntimeCapability<Void> SERVER_ENVIRONMENT_CAPABILITY = RuntimeCapability.Builder.of(SERVER_ENVIRONMENT_SERVICE_NAME, ServerEnvironment.class).build();


/**
* Construct a new instance.
Expand Down

0 comments on commit 3be5b14

Please sign in to comment.