use of org.jboss.as.server.mgmt.domain.HostControllerConnectionService in project wildfly-core by wildfly.
the class DomainServerCommunicationServices method activate.
@Override
public void activate(final ServiceActivatorContext serviceActivatorContext) throws ServiceRegistryException {
final ServiceTarget serviceTarget = serviceActivatorContext.getServiceTarget();
final ServiceName endpointName = managementSubsystemEndpoint ? RemotingServices.SUBSYSTEM_ENDPOINT : ManagementRemotingServices.MANAGEMENT_ENDPOINT;
final EndpointService.EndpointType endpointType = managementSubsystemEndpoint ? EndpointService.EndpointType.SUBSYSTEM : EndpointService.EndpointType.MANAGEMENT;
try {
ManagementWorkerService.installService(serviceTarget);
// TODO see if we can figure out a way to work in the vault resolver instead of having to use ExpressionResolver.SIMPLE
@SuppressWarnings("deprecation") final OptionMap options = EndpointConfigFactory.create(ExpressionResolver.SIMPLE, endpointConfig, DEFAULTS);
ManagementRemotingServices.installRemotingManagementEndpoint(serviceTarget, endpointName, WildFlySecurityManager.getPropertyPrivileged(ServerEnvironment.NODE_NAME, null), endpointType, options);
// Install the communication services
final ServiceBuilder<?> sb = serviceTarget.addService(HostControllerConnectionService.SERVICE_NAME);
final Supplier<ExecutorService> esSupplier = Services.requireServerExecutor(sb);
final Supplier<ScheduledExecutorService> sesSupplier = sb.requires(ServerService.JBOSS_SERVER_SCHEDULED_EXECUTOR);
final Supplier<Endpoint> eSupplier = sb.requires(endpointName);
final Supplier<ProcessStateNotifier> cpsnSupplier = sb.requires(ControlledProcessStateService.INTERNAL_SERVICE_NAME);
sb.setInstance(new HostControllerConnectionService(managementURI, serverName, serverProcessName, authKey, initialOperationID, managementSubsystemEndpoint, sslContextSupplier, esSupplier, sesSupplier, eSupplier, cpsnSupplier));
sb.install();
} catch (OperationFailedException e) {
throw new ServiceRegistryException(e);
}
}
Aggregations