public static void addService(final ServiceTarget serviceTarget) { //ServerDeploymentRepositoryImpl service = new ServerDeploymentRepositoryImpl(); final ServiceBuilder<?> sb = serviceTarget.addService(DeploymentMountProvider.SERVICE_NAME); final Consumer<DeploymentMountProvider> dmpConsumer = sb.provides(DeploymentMountProvider.SERVICE_NAME); final Supplier<ExecutorService> esSupplier = org.jboss.as.server.Services.requireServerExecutor(sb); sb.setInstance(new ServerDeploymentRepositoryImpl(dmpConsumer, esSupplier)); sb.install(); }
static void install(ServiceTarget serviceTarget, ProcessType processType, RunningMode runningMode, String listenerName, ProcessStateListener listener, Map<String, String> properties, int timeout) { final ServiceBuilder<?> builder = serviceTarget.addService(SERVICE_NAME.append(listenerName)); final Supplier<ControlledProcessStateService> cpssSupplier = builder.requires(ControlledProcessStateService.SERVICE_NAME); final Supplier<ExecutorService> esSupplier = Services.requireServerExecutor(builder); final Supplier<SuspendController> scSupplier = !processType.isHostController() ? builder.requires(JBOSS_SUSPEND_CONTROLLER) : null; builder.setInstance(new ProcessStateListenerService(processType, runningMode, listenerName, listener, properties, timeout, cpssSupplier, scSupplier, esSupplier)); builder.install(); }
static ServiceController<?> addService(final ServiceTarget serviceTarget, final ServiceName serviceName, final String managementName, final byte[] hash) { final ServiceBuilder<?> sb = serviceTarget.addService(serviceName); final Consumer<VirtualFile> vfConsumer = sb.provides(serviceName); final Supplier<ContentRepository> crSupplier = sb.requires(ContentRepository.SERVICE_NAME); final Supplier<ServerEnvironment> seSupplier = sb.requires(ServerEnvironmentService.SERVICE_NAME); final Supplier<ExecutorService> esSupplier = requireServerExecutor(sb); sb.setInstance(new ManagedExplodedContentServitor(managementName, hash, vfConsumer, crSupplier, seSupplier, esSupplier)); return sb.install(); }
public static void addService(final ServiceTarget serviceTarget, final ServiceName clientFactoryService, final ServiceName scheduledExecutorServiceName) { final ServiceBuilder<?> builder = serviceTarget.addService(SERVICE_NAME); final Supplier<ModelControllerClientFactory> mccfSupplier = builder.requires(clientFactoryService); final Supplier<ControlledProcessStateService> cpssSupplier = builder.requires(ControlledProcessStateService.SERVICE_NAME); final Supplier<ScheduledExecutorService> sesSupplier = builder.requires(scheduledExecutorServiceName); final Supplier<ExecutorService> esSupplier = Services.requireServerExecutor(builder); builder.setInstance(new ContentCleanerService(true, mccfSupplier, cpssSupplier, sesSupplier, esSupplier)); builder.install(); }
@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); } }