/** * 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); }