@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 { // TODO see if we can figure out a way to work in the vault resolver instead of having to use ExpressionResolver.DEFAULT @SuppressWarnings("deprecation") final OptionMap options = EndpointConfigFactory.create(ExpressionResolver.DEFAULT, endpointConfig, DEFAULTS); ManagementRemotingServices.installRemotingManagementEndpoint(serviceTarget, endpointName, WildFlySecurityManager.getPropertyPrivileged(ServerEnvironment.NODE_NAME, null), endpointType, options, null, null); // Install the communication services final int port = managementSocket.getPort(); final String host = NetworkUtils.canonize(managementSocket.getAddress().getHostAddress()); HostControllerConnectionService service = new HostControllerConnectionService(host, port, serverName, serverProcessName, authKey, initialOperationID, managementSubsystemEndpoint); Services.addServerExecutorDependency(serviceTarget.addService(HostControllerConnectionService.SERVICE_NAME, service), service.getExecutorInjector(), false) .addDependency(endpointName, Endpoint.class, service.getEndpointInjector()) .addDependency(ControlledProcessStateService.SERVICE_NAME, ControlledProcessStateService.class, service.getProcessStateServiceInjectedValue()) .setInitialMode(ServiceController.Mode.ACTIVE).install(); } catch (OperationFailedException e) { throw new ServiceRegistryException(e); } }
static synchronized void installRemotingServicesIfNotInstalled(final ServiceTarget serviceTarget, final String hostName, final ServiceVerificationHandler verificationHandler, final List<ServiceController<?>> newControllers, final ServiceRegistry serviceContainer) { if (serviceContainer.getService(ManagementRemotingServices.MANAGEMENT_ENDPOINT) == null) { ManagementChannelRegistryService.addService(serviceTarget, ManagementRemotingServices.MANAGEMENT_ENDPOINT); ManagementRemotingServices.installRemotingManagementEndpoint(serviceTarget, ManagementRemotingServices.MANAGEMENT_ENDPOINT, hostName, EndpointService.EndpointType.MANAGEMENT, OPTIONS, verificationHandler, newControllers); ManagementRemotingServices.installManagementChannelServices(serviceTarget, ManagementRemotingServices.MANAGEMENT_ENDPOINT, new ModelControllerClientOperationHandlerFactoryService(), Services.JBOSS_SERVER_CONTROLLER, ManagementRemotingServices.MANAGEMENT_CHANNEL, Services.JBOSS_SERVER_EXECUTOR, verificationHandler, newControllers); } } }
static synchronized void installRemotingServicesIfNotInstalled(final ServiceTarget serviceTarget, final String hostName, final ServiceRegistry serviceContainer) { if (serviceContainer.getService(ManagementRemotingServices.MANAGEMENT_ENDPOINT) == null) { ManagementChannelRegistryService.addService(serviceTarget, ManagementRemotingServices.MANAGEMENT_ENDPOINT); ManagementRemotingServices.installRemotingManagementEndpoint(serviceTarget, ManagementRemotingServices.MANAGEMENT_ENDPOINT, hostName, EndpointService.EndpointType.MANAGEMENT, OPTIONS); ManagementRemotingServices.installManagementChannelServices(serviceTarget, ManagementRemotingServices.MANAGEMENT_ENDPOINT, new ModelControllerClientOperationHandlerFactoryService(), Services.JBOSS_SERVER_CONTROLLER, ManagementRemotingServices.MANAGEMENT_CHANNEL, ServerService.EXECUTOR_CAPABILITY.getCapabilityServiceName(), ServerService.JBOSS_SERVER_SCHEDULED_EXECUTOR); } } }
@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 HostControllerConnectionService service = new HostControllerConnectionService(managementURI, serverName, serverProcessName, authKey, initialOperationID, managementSubsystemEndpoint, sslContextSupplier); Services.addServerExecutorDependency(serviceTarget.addService(HostControllerConnectionService.SERVICE_NAME, service), service.getExecutorInjector()) .addDependency(ServerService.JBOSS_SERVER_SCHEDULED_EXECUTOR, ScheduledExecutorService.class, service.getScheduledExecutorInjector()) .addDependency(endpointName, Endpoint.class, service.getEndpointInjector()) .addDependency(ControlledProcessStateService.SERVICE_NAME, ControlledProcessStateService.class, service.getProcessStateServiceInjectedValue()) .setInitialMode(ServiceController.Mode.ACTIVE).install(); } catch (OperationFailedException e) { throw new ServiceRegistryException(e); } }
static synchronized void installRemotingServicesIfNotInstalled(final ServiceTarget serviceTarget, final String hostName, final ServiceRegistry serviceContainer) { if (serviceContainer.getService(ManagementRemotingServices.MANAGEMENT_ENDPOINT) == null) { ManagementChannelRegistryService.addService(serviceTarget, ManagementRemotingServices.MANAGEMENT_ENDPOINT); ManagementRemotingServices.installRemotingManagementEndpoint(serviceTarget, ManagementRemotingServices.MANAGEMENT_ENDPOINT, hostName, EndpointService.EndpointType.MANAGEMENT, OPTIONS); ManagementRemotingServices.installManagementChannelServices(serviceTarget, ManagementRemotingServices.MANAGEMENT_ENDPOINT, new ModelControllerClientOperationHandlerFactoryService(), Services.JBOSS_SERVER_CONTROLLER, ManagementRemotingServices.MANAGEMENT_CHANNEL, ServerService.EXECUTOR_CAPABILITY.getCapabilityServiceName(), ServerService.JBOSS_SERVER_SCHEDULED_EXECUTOR); } } }
static synchronized void installRemotingServicesIfNotInstalled(final ServiceTarget serviceTarget, final String hostName, final ServiceRegistry serviceContainer, final boolean onDemand) { if (serviceContainer.getService(ManagementRemotingServices.MANAGEMENT_ENDPOINT) == null) { ManagementChannelRegistryService.addService(serviceTarget, ManagementRemotingServices.MANAGEMENT_ENDPOINT); ManagementRemotingServices.installRemotingManagementEndpoint(serviceTarget, ManagementRemotingServices.MANAGEMENT_ENDPOINT, hostName, EndpointService.EndpointType.MANAGEMENT, CONNECTION_OPTIONS); ManagementRemotingServices.installManagementChannelOpenListenerService(serviceTarget, ManagementRemotingServices.MANAGEMENT_ENDPOINT, ManagementRemotingServices.SERVER_CHANNEL, ServerToHostOperationHandlerFactoryService.SERVICE_NAME, SERVICE_OPTIONS, onDemand); ManagementRemotingServices.installManagementChannelServices(serviceTarget, ManagementRemotingServices.MANAGEMENT_ENDPOINT, new ModelControllerClientOperationHandlerFactoryService(), DomainModelControllerService.SERVICE_NAME, ManagementRemotingServices.MANAGEMENT_CHANNEL, DomainModelControllerService.EXECUTOR_CAPABILITY.getCapabilityServiceName(), HostControllerService.HC_SCHEDULED_EXECUTOR_SERVICE_NAME); } } }
static synchronized void installRemotingServicesIfNotInstalled(final ServiceTarget serviceTarget, final String hostName, final ServiceRegistry serviceContainer, final boolean onDemand) { if (serviceContainer.getService(ManagementRemotingServices.MANAGEMENT_ENDPOINT) == null) { ManagementChannelRegistryService.addService(serviceTarget, ManagementRemotingServices.MANAGEMENT_ENDPOINT); ManagementRemotingServices.installRemotingManagementEndpoint(serviceTarget, ManagementRemotingServices.MANAGEMENT_ENDPOINT, hostName, EndpointService.EndpointType.MANAGEMENT, CONNECTION_OPTIONS); ManagementRemotingServices.installManagementChannelOpenListenerService(serviceTarget, ManagementRemotingServices.MANAGEMENT_ENDPOINT, ManagementRemotingServices.SERVER_CHANNEL, ServerToHostOperationHandlerFactoryService.SERVICE_NAME, SERVICE_OPTIONS, onDemand); ManagementRemotingServices.installManagementChannelServices(serviceTarget, ManagementRemotingServices.MANAGEMENT_ENDPOINT, new ModelControllerClientOperationHandlerFactoryService(), DomainModelControllerService.SERVICE_NAME, ManagementRemotingServices.MANAGEMENT_CHANNEL, DomainModelControllerService.EXECUTOR_CAPABILITY.getCapabilityServiceName(), HostControllerService.HC_SCHEDULED_EXECUTOR_SERVICE_NAME); } } }
@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<ControlledProcessStateService> cpssSupplier = sb.requires(ControlledProcessStateService.SERVICE_NAME); sb.setInstance(new HostControllerConnectionService(managementURI, serverName, serverProcessName, authKey, initialOperationID, managementSubsystemEndpoint, sslContextSupplier, esSupplier, sesSupplier, eSupplier, cpssSupplier)); sb.install(); } catch (OperationFailedException e) { throw new ServiceRegistryException(e); } }