Search in sources :

Example 1 with HostControllerConnectionService

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);
    }
}
Also used : ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) ServiceTarget(org.jboss.msc.service.ServiceTarget) OperationFailedException(org.jboss.as.controller.OperationFailedException) EndpointService(org.jboss.as.remoting.EndpointService) ProcessStateNotifier(org.jboss.as.controller.ProcessStateNotifier) ServiceRegistryException(org.jboss.msc.service.ServiceRegistryException) HostControllerConnectionService(org.jboss.as.server.mgmt.domain.HostControllerConnectionService) Endpoint(org.jboss.remoting3.Endpoint) ServiceName(org.jboss.msc.service.ServiceName) OptionMap(org.xnio.OptionMap) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) ExecutorService(java.util.concurrent.ExecutorService)

Aggregations

ExecutorService (java.util.concurrent.ExecutorService)1 ScheduledExecutorService (java.util.concurrent.ScheduledExecutorService)1 OperationFailedException (org.jboss.as.controller.OperationFailedException)1 ProcessStateNotifier (org.jboss.as.controller.ProcessStateNotifier)1 EndpointService (org.jboss.as.remoting.EndpointService)1 HostControllerConnectionService (org.jboss.as.server.mgmt.domain.HostControllerConnectionService)1 ServiceName (org.jboss.msc.service.ServiceName)1 ServiceRegistryException (org.jboss.msc.service.ServiceRegistryException)1 ServiceTarget (org.jboss.msc.service.ServiceTarget)1 Endpoint (org.jboss.remoting3.Endpoint)1 OptionMap (org.xnio.OptionMap)1