/** * Set up the services to create a channel listener and operation handler service. * @param serviceTarget the service target to install the services into * @param endpointName the endpoint name to install the services into * @param channelName the name of the channel * @param executorServiceName service name of the executor service to use in the operation handler service * @param scheduledExecutorServiceName service name of the scheduled executor service to use in the operation handler service */ public static void installManagementChannelServices( final ServiceTarget serviceTarget, final ServiceName endpointName, final AbstractModelControllerOperationHandlerFactoryService operationHandlerService, final ServiceName modelControllerName, final String channelName, final ServiceName executorServiceName, final ServiceName scheduledExecutorServiceName) { final OptionMap options = OptionMap.EMPTY; final ServiceName operationHandlerName = endpointName.append(channelName).append(ModelControllerClientOperationHandlerFactoryService.OPERATION_HANDLER_NAME_SUFFIX); serviceTarget.addService(operationHandlerName, operationHandlerService) .addDependency(modelControllerName, ModelController.class, operationHandlerService.getModelControllerInjector()) .addDependency(executorServiceName, ExecutorService.class, operationHandlerService.getExecutorInjector()) .addDependency(scheduledExecutorServiceName, ScheduledExecutorService.class, operationHandlerService.getScheduledExecutorInjector()) .setInitialMode(ACTIVE) .install(); installManagementChannelOpenListenerService(serviceTarget, endpointName, channelName, operationHandlerName, options, false); }
/** * Set up the services to create a channel listener and operation handler service. * * @param serviceTarget the service target to install the services into * @param endpointName the endpoint name to install the services into * @param channelName the name of the channel * @param verificationHandler * @param newControllers list to add the new services to */ public static void installManagementChannelServices( final ServiceTarget serviceTarget, final ServiceName endpointName, final AbstractModelControllerOperationHandlerFactoryService operationHandlerService, final ServiceName modelControllerName, final String channelName, final ServiceVerificationHandler verificationHandler, final List<ServiceController<?>> newControllers) { final OptionMap options = OptionMap.create(RemotingOptions.RECEIVE_WINDOW_SIZE, ProtocolChannelClient.Configuration.WINDOW_SIZE, RemotingOptions.TRANSMIT_WINDOW_SIZE, ProtocolChannelClient.Configuration.WINDOW_SIZE); final ServiceName operationHandlerName = endpointName.append(channelName).append(ModelControllerClientOperationHandlerFactoryService.OPERATION_HANDLER_NAME_SUFFIX); final ServiceBuilder<?> builder = serviceTarget.addService(operationHandlerName, operationHandlerService) .addDependency(modelControllerName, ModelController.class, operationHandlerService.getModelControllerInjector()) .setInitialMode(ACTIVE); addController(newControllers, verificationHandler, builder); installManagementChannelOpenListenerService(serviceTarget, endpointName, channelName, operationHandlerName, options, verificationHandler, newControllers, false); }
public static void installNativeManagementServices(final ServiceTarget serviceTarget, final LocalHostControllerInfo hostControllerInfo, final ServiceVerificationHandler verificationHandler, final List<ServiceController<?>> newControllers, final boolean onDemand) { ServiceName realmSvcName = null; String nativeSecurityRealm = hostControllerInfo.getNativeManagementSecurityRealm(); if (nativeSecurityRealm != null) { realmSvcName = SecurityRealmService.BASE_SERVICE_NAME.append(nativeSecurityRealm); } final ServiceName nativeManagementInterfaceBinding = NetworkInterfaceService.JBOSS_NETWORK_INTERFACE.append(hostControllerInfo.getNativeManagementInterface()); ManagementRemotingServices.installDomainConnectorServices(serviceTarget, ManagementRemotingServices.MANAGEMENT_ENDPOINT, nativeManagementInterfaceBinding, hostControllerInfo.getNativeManagementPort(), realmSvcName, CONNECTION_OPTIONS, verificationHandler, newControllers); ManagementRemotingServices.installManagementChannelOpenListenerService(serviceTarget, ManagementRemotingServices.MANAGEMENT_ENDPOINT, ManagementRemotingServices.SERVER_CHANNEL, ServerToHostOperationHandlerFactoryService.SERVICE_NAME, SERVICE_OPTIONS, verificationHandler, newControllers, onDemand); ManagementRemotingServices.installManagementChannelServices(serviceTarget, ManagementRemotingServices.MANAGEMENT_ENDPOINT, new ModelControllerClientOperationHandlerFactoryService(), DomainModelControllerService.SERVICE_NAME, ManagementRemotingServices.MANAGEMENT_CHANNEL, verificationHandler, newControllers); RemotingConnectorService.addService(serviceTarget, verificationHandler); }
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); } } }