@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.installRemotingEndpoint(serviceTarget, endpointName, SecurityActions.getSystemProperty(ServerEnvironment.NODE_NAME), endpointType, options, null, null); // Install the communication services final int port = managementSocket.getPort(); final String host = managementSocket.getAddress().getHostAddress(); HostControllerConnectionService service = new HostControllerConnectionService(host, port, serverName, serverProcessName, authKey, managementSubsystemEndpoint); serviceTarget.addService(HostControllerConnectionService.SERVICE_NAME, service) .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); } }
@Override protected void performRuntime(final OperationContext context, final ModelNode operation, final ModelNode model, final ServiceVerificationHandler verificationHandler, final List<ServiceController<?>> newControllers) throws OperationFailedException { populateHostControllerInfo(hostControllerInfo, context, model); final ServiceTarget serviceTarget = context.getServiceTarget(); ManagementChannelRegistryService.addService(serviceTarget, ManagementRemotingServices.MANAGEMENT_ENDPOINT); ManagementRemotingServices.installRemotingEndpoint(serviceTarget, ManagementRemotingServices.MANAGEMENT_ENDPOINT, hostControllerInfo.getLocalHostName(), EndpointService.EndpointType.MANAGEMENT, CONNECTION_OPTIONS, null, null); final boolean onDemand = context.isBooting(); installNativeManagementServices(serviceTarget, hostControllerInfo, verificationHandler, newControllers, onDemand); }
@Override protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model, ServiceVerificationHandler verificationHandler, List<ServiceController<?>> newControllers) throws OperationFailedException { final ServiceTarget serviceTarget = context.getServiceTarget(); final ServiceName endpointName = ManagementRemotingServices.MANAGEMENT_ENDPOINT; final String hostName = SecurityActions.getSystemProperty(ServerEnvironment.NODE_NAME); ManagementRemotingServices.installRemotingEndpoint(serviceTarget, ManagementRemotingServices.MANAGEMENT_ENDPOINT, hostName, EndpointService.EndpointType.MANAGEMENT, options, verificationHandler, newControllers); installNativeManagementConnector(context, model, endpointName, serviceTarget, verificationHandler, newControllers); ManagementChannelRegistryService.addService(serviceTarget, endpointName); ManagementRemotingServices.installManagementChannelServices(serviceTarget, endpointName, new ModelControllerClientOperationHandlerFactoryService(), Services.JBOSS_SERVER_CONTROLLER, ManagementRemotingServices.MANAGEMENT_CHANNEL, verificationHandler, newControllers); }