Java Code Examples for org.jboss.msc.service.ServiceBuilder#install()
The following examples show how to use
org.jboss.msc.service.ServiceBuilder#install() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HostPathManagerService.java From wildfly-core with GNU Lesser General Public License v2.1 | 6 votes |
public static ServiceController<?> addService(ServiceTarget serviceTarget, HostPathManagerService service, HostControllerEnvironment hostEnvironment) { ServiceBuilder<?> serviceBuilder = serviceTarget.addService(AbstractControllerService.PATH_MANAGER_CAPABILITY.getCapabilityServiceName(), service).addAliases(SERVICE_NAME); // Add resources and capabilities for the always-present paths service.addHardcodedAbsolutePath(serviceTarget, HostControllerEnvironment.HOME_DIR, hostEnvironment.getHomeDir().getAbsolutePath()); service.addHardcodedAbsolutePath(serviceTarget, HostControllerEnvironment.DOMAIN_BASE_DIR, hostEnvironment.getDomainConfigurationDir().getAbsolutePath()); service.addHardcodedAbsolutePath(serviceTarget, HostControllerEnvironment.DOMAIN_CONFIG_DIR, hostEnvironment.getDomainConfigurationDir().getAbsolutePath()); service.addHardcodedAbsolutePath(serviceTarget, HostControllerEnvironment.DOMAIN_DATA_DIR, hostEnvironment.getDomainDataDir().getAbsolutePath()); service.addHardcodedAbsolutePath(serviceTarget, HostControllerEnvironment.DOMAIN_LOG_DIR, hostEnvironment.getDomainLogDir().getAbsolutePath()); service.addHardcodedAbsolutePath(serviceTarget, HostControllerEnvironment.DOMAIN_TEMP_DIR, hostEnvironment.getDomainTempDir().getAbsolutePath()); service.addHardcodedAbsolutePath(serviceTarget, HostControllerEnvironment.CONTROLLER_TEMP_DIR, hostEnvironment.getDomainTempDir().getAbsolutePath()); // Registering the actual standard server path capabilities so server config resources can reference them //TODO look if those registrations could be moved to ServerService/DomainModelControllerService.initModel registerServerPathCapability(service.localCapRegRef, ServerEnvironment.SERVER_BASE_DIR); registerServerPathCapability(service.localCapRegRef, ServerEnvironment.SERVER_CONFIG_DIR); registerServerPathCapability(service.localCapRegRef, ServerEnvironment.SERVER_DATA_DIR); registerServerPathCapability(service.localCapRegRef, ServerEnvironment.SERVER_LOG_DIR); registerServerPathCapability(service.localCapRegRef, ServerEnvironment.SERVER_TEMP_DIR); return serviceBuilder.install(); }
Example 2
Source File: SecurityRealmAddHandler.java From wildfly-core with GNU Lesser General Public License v2.1 | 6 votes |
private Supplier<CallbackHandlerFactory> addSecretService(OperationContext context, ModelNode secret, String realmName, ServiceTarget serviceTarget, ServiceBuilder<?> realmBuilder) throws OperationFailedException { final ServiceName secretServiceName = SecretIdentityService.ServiceUtil.createServiceName(realmName); final ModelNode resolvedValueNode = SecretServerIdentityResourceDefinition.VALUE.resolveModelAttribute(context, secret); boolean base64 = secret.get(SecretServerIdentityResourceDefinition.VALUE.getName()).getType() != ModelType.EXPRESSION; final ServiceBuilder<?> builder = serviceTarget.addService(secretServiceName); final Consumer<CallbackHandlerFactory> chfConsumer = builder.provides(secretServiceName); ExceptionSupplier<CredentialSource, Exception> credentialSourceSupplier = null; if (secret.hasDefined(CredentialReference.CREDENTIAL_REFERENCE)) { String keySuffix = SERVER_IDENTITY + KEY_DELIMITER + SECRET; credentialSourceSupplier = CredentialReference.getCredentialSourceSupplier(context, SecretServerIdentityResourceDefinition.CREDENTIAL_REFERENCE, secret, builder, keySuffix); } SecretIdentityService sis; if (secret.hasDefined(CredentialReference.CREDENTIAL_REFERENCE)) { sis = new SecretIdentityService(chfConsumer, credentialSourceSupplier, resolvedValueNode.asString(), false); } else { sis = new SecretIdentityService(chfConsumer, credentialSourceSupplier, resolvedValueNode.asString(), base64); } builder.setInstance(sis); builder.setInitialMode(ON_DEMAND); builder.install(); return CallbackHandlerFactory.ServiceUtil.requires(realmBuilder, secretServiceName); }
Example 3
Source File: SecurityRealmAddHandler.java From wildfly-core with GNU Lesser General Public License v2.1 | 6 votes |
private Supplier<CallbackHandlerService> addLocalService(OperationContext context, ModelNode local, String realmName, ServiceTarget serviceTarget, ServiceBuilder<?> realmBuilder) throws OperationFailedException { ServiceName localServiceName = LocalCallbackHandlerService.ServiceUtil.createServiceName(realmName); ModelNode node = LocalAuthenticationResourceDefinition.DEFAULT_USER.resolveModelAttribute(context, local); String defaultUser = node.isDefined() ? node.asString() : null; node = LocalAuthenticationResourceDefinition.ALLOWED_USERS.resolveModelAttribute(context, local); String allowedUsers = node.isDefined() ? node.asString() : null; node = LocalAuthenticationResourceDefinition.SKIP_GROUP_LOADING.resolveModelAttribute(context, local); boolean skipGroupLoading = node.asBoolean(); final ServiceBuilder<?> builder = serviceTarget.addService(localServiceName); final Consumer<CallbackHandlerService> chsConsumer = builder.provides(localServiceName); builder.setInstance(new LocalCallbackHandlerService(chsConsumer, defaultUser, allowedUsers, skipGroupLoading)); builder.setInitialMode(ON_DEMAND); builder.install(); return CallbackHandlerService.ServiceUtil.requires(realmBuilder, localServiceName); }
Example 4
Source File: SecurityRealmAddHandler.java From wildfly-core with GNU Lesser General Public License v2.1 | 5 votes |
private Supplier<CallbackHandlerService> addUsersService(OperationContext context, ModelNode users, String realmName, ServiceTarget serviceTarget, ServiceBuilder<?> realmBuilder) throws OperationFailedException { final ServiceName usersServiceName = UserDomainCallbackHandler.ServiceUtil.createServiceName(realmName); final ServiceBuilder<?> builder = serviceTarget.addService(usersServiceName); final Consumer<CallbackHandlerService> chsConsumer = builder.provides(usersServiceName); builder.setInstance(new UserDomainCallbackHandler(chsConsumer, unmaskUsersCredentials(context, builder, users.clone()), realmName, unmaskUsersPasswords(context, users))); builder.setInitialMode(ServiceController.Mode.ON_DEMAND); builder.install(); return CallbackHandlerService.ServiceUtil.requires(realmBuilder, usersServiceName); }
Example 5
Source File: RemotingLegacySubsystemTestCase.java From wildfly-core with GNU Lesser General Public License v2.1 | 5 votes |
private AdditionalInitialization createRuntimeAdditionalInitialization(final boolean legacyParser) { return new AdditionalInitialization() { @Override protected void setupController(ControllerInitializer controllerInitializer) { controllerInitializer.addSocketBinding("test", 27258); controllerInitializer.addRemoteOutboundSocketBinding("dummy-outbound-socket", "localhost", 6799); controllerInitializer.addRemoteOutboundSocketBinding("other-outbound-socket", "localhost", 1234); } @Override protected void addExtraServices(ServiceTarget target) { //Needed for initialization of the RealmAuthenticationProviderService AbsolutePathService.addService(ServerEnvironment.CONTROLLER_TEMP_DIR, new File("target/temp" + System.currentTimeMillis()).getAbsolutePath(), target); if (!legacyParser) { ServiceBuilder<?> builder = target.addService(IOServices.WORKER.append("default")); Consumer<XnioWorker> workerConsumer = builder.provides(IOServices.WORKER.append("default")); builder.setInstance(new WorkerService(workerConsumer, () -> Executors.newFixedThreadPool(1), Xnio.getInstance().createWorkerBuilder().setWorkerIoThreads(2))); builder.install(); } } @Override protected void initializeExtraSubystemsAndModel(ExtensionRegistry extensionRegistry, Resource rootResource, ManagementResourceRegistration rootRegistration, RuntimeCapabilityRegistry capabilityRegistry) { super.initializeExtraSubystemsAndModel(extensionRegistry, rootResource, rootRegistration, capabilityRegistry); Map<String, Class> capabilities = new HashMap<>(); capabilities.put(buildDynamicCapabilityName(IO_WORKER_CAPABILITY_NAME, "default-remoting"), XnioWorker.class); if (legacyParser) { // Deal with the fact that legacy parsers will add the io extension/subsystem RemotingSubsystemTestUtil.registerIOExtension(extensionRegistry, rootRegistration); } else { capabilities.put(buildDynamicCapabilityName(IO_WORKER_CAPABILITY_NAME, RemotingSubsystemRootResource.WORKER.getDefaultValue().asString()), XnioWorker.class); } AdditionalInitialization.registerServiceCapabilities(capabilityRegistry, capabilities); } }; }
Example 6
Source File: DiscoveryService.java From wildfly-core with GNU Lesser General Public License v2.1 | 5 votes |
static void install(final ServiceTarget serviceTarget, final List<DiscoveryOption> discoveryOptions, final List<DomainControllerManagementInterface> managementInterfaces, final boolean isMasterDomainController) { final DiscoveryService discovery = new DiscoveryService(discoveryOptions, managementInterfaces, isMasterDomainController); ServiceBuilder builder = serviceTarget.addService(DiscoveryService.SERVICE_NAME, discovery) .addDependency(HostControllerService.HC_EXECUTOR_SERVICE_NAME, ExecutorService.class, discovery.executorService); Set<String> alreadyDefinedInterfaces = new HashSet<String>(); for(DomainControllerManagementInterface managementInterface : managementInterfaces) { if(!alreadyDefinedInterfaces.contains(managementInterface.getAddress())) { builder.addDependency(NetworkInterfaceService.JBOSS_NETWORK_INTERFACE.append(managementInterface.getAddress()), NetworkInterfaceBinding.class, discovery.interfaceBindings.get(managementInterface.getAddress())); alreadyDefinedInterfaces.add(managementInterface.getAddress()); } } builder.install(); }
Example 7
Source File: ContentCleanerService.java From wildfly-core with GNU Lesser General Public License v2.1 | 5 votes |
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<ProcessStateNotifier> cpsnSupplier = builder.requires(ControlledProcessStateService.INTERNAL_SERVICE_NAME); final Supplier<ScheduledExecutorService> sesSupplier = builder.requires(scheduledExecutorServiceName); final Supplier<ExecutorService> esSupplier = Services.requireServerExecutor(builder); builder.setInstance(new ContentCleanerService(true, mccfSupplier, cpsnSupplier, sesSupplier, esSupplier)); builder.install(); }
Example 8
Source File: ManagedExplodedContentServitor.java From wildfly-core with GNU Lesser General Public License v2.1 | 5 votes |
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(); }
Example 9
Source File: RemotingServices.java From wildfly-core with GNU Lesser General Public License v2.1 | 5 votes |
public static void installRemotingManagementEndpoint(final ServiceTarget serviceTarget, final ServiceName endpointName, final String hostName, final EndpointService.EndpointType type, final OptionMap options) { final ServiceBuilder<?> builder = serviceTarget.addService(endpointName); final Consumer<Endpoint> endpointConsumer = builder.provides(endpointName); final Supplier<XnioWorker> workerSupplier = builder.requires(ServiceName.JBOSS.append("serverManagement", "controller", "management", "worker")); builder.setInstance(new EndpointService(endpointConsumer, workerSupplier, hostName, type, options)); builder.install(); }
Example 10
Source File: BindingUtil.java From camunda-bpm-platform with Apache License 2.0 | 5 votes |
public static ServiceController<ManagedReferenceFactory> createJndiBindings(ServiceTarget target, ServiceName serviceName, String binderServiceName, ManagedReferenceFactory managedReferenceFactory) { BinderService binderService = new BinderService(binderServiceName); ServiceBuilder<ManagedReferenceFactory> serviceBuilder = target .addService(serviceName, binderService) .addDependency(ContextNames.GLOBAL_CONTEXT_SERVICE_NAME, ServiceBasedNamingStore.class, binderService.getNamingStoreInjector()); binderService.getManagedObjectInjector().inject(managedReferenceFactory); return serviceBuilder.install(); }
Example 11
Source File: DomainManagedServerCallbackHandler.java From wildfly-core with GNU Lesser General Public License v2.1 | 5 votes |
public static void install(final ServiceTarget serviceTarget) { final ServiceBuilder<?> builder = serviceTarget.addService(DomainManagedServerCallbackHandler.SERVICE_NAME); final Consumer<CallbackHandlerService> chsConsumer = builder.provides(DomainManagedServerCallbackHandler.SERVICE_NAME); builder.setInstance(new DomainManagedServerCallbackHandler(chsConsumer)); builder.setInitialMode(ON_DEMAND); builder.install(); }
Example 12
Source File: AbstractProxyControllerTest.java From wildfly-core with GNU Lesser General Public License v2.1 | 5 votes |
@Before public void setupController() throws Exception { executor = Executors.newCachedThreadPool(); container = ServiceContainer.Factory.create("test"); ServiceTarget target = container.subTarget(); ControlledProcessState processState = new ControlledProcessState(true); ProxyModelControllerService proxyService = new ProxyModelControllerService(processState); target.addService(ServiceName.of("ProxyModelController")).setInstance(proxyService).install(); ServiceBuilder<?> mainBuilder = target.addService(ServiceName.of("MainModelController")); Supplier<ModelController> proxy = mainBuilder.requires(ServiceName.of("ProxyModelController")); MainModelControllerService mainService = new MainModelControllerService(proxy, processState); mainBuilder.setInstance(mainService); mainBuilder.install(); proxyService.awaitStartup(30, TimeUnit.SECONDS); mainService.awaitStartup(30, TimeUnit.SECONDS); // execute operation to initialize the controller model final ModelNode operation = new ModelNode(); operation.get(OP).set("setup"); operation.get(OP_ADDR).setEmptyList(); mainControllerClient = mainService.getValue().createClient(executor); mainControllerClient.execute(operation); proxiedControllerClient = proxyService.getValue().createClient(executor); proxiedControllerClient.execute(operation); }
Example 13
Source File: SecurityRealmAddHandler.java From wildfly-core with GNU Lesser General Public License v2.1 | 5 votes |
private Supplier<SubjectSupplementalService> addPlugInAuthorizationService(OperationContext context, ModelNode model, String realmName, ServiceTarget serviceTarget, ServiceBuilder<?> realmBuilder) throws OperationFailedException { final ServiceName plugInServiceName = PlugInSubjectSupplemental.ServiceUtil.createServiceName(realmName); final String pluginName = PlugInAuthorizationResourceDefinition.NAME.resolveModelAttribute(context, model).asString(); final Map<String, String> properties = resolveProperties(context, model); final ServiceBuilder<?> builder = serviceTarget.addService(plugInServiceName); final Consumer<SubjectSupplementalService> sssConsumer = builder.provides(plugInServiceName); final Supplier<PlugInLoaderService> pilSupplier = PlugInLoaderService.ServiceUtil.requires(builder, realmName); builder.setInstance(new PlugInSubjectSupplemental(sssConsumer, pilSupplier, realmName, pluginName, properties)); builder.setInitialMode(ON_DEMAND); builder.install(); return SubjectSupplementalService.ServiceUtil.requires(realmBuilder, plugInServiceName); }
Example 14
Source File: SecurityRealmServiceUtilTestCase.java From wildfly-core with GNU Lesser General Public License v2.1 | 5 votes |
/** * Tests that SecurityRealm.ServiceUtil's dependency injection works regardless of what * ServiceTarget API was used for creating the target ServiceBuilder. */ @SuppressWarnings("deprecation") @Test public void testDifferentServiceBuilderTypes() { ServiceTarget serviceTarget = container.subTarget(); final Supplier<String> tmpDirSupplier = () -> tmpDir.toAbsolutePath().toString(); final ServiceName realmServiceName = SecurityRealm.ServiceUtil.createServiceName(TESTNAME); final ServiceBuilder<?> realmBuilder = serviceTarget.addService(realmServiceName); final Consumer<SecurityRealm> securityRealmConsumer = realmBuilder.provides(realmServiceName, SecurityRealm.ServiceUtil.createLegacyServiceName(TESTNAME)); final SecurityRealmService securityRealmService = new SecurityRealmService(securityRealmConsumer, null, null, null, null, tmpDirSupplier, new HashSet(), TESTNAME, false); realmBuilder.setInstance(securityRealmService); final ServiceController<?> realmController = realmBuilder.install(); TestService legacy = new TestService(); ServiceBuilder legacyBuilder = serviceTarget.addService(ServiceName.of("LEGACY"), legacy); SecurityRealm.ServiceUtil.addDependency(legacyBuilder, legacy.injector, TESTNAME); ServiceController<?> legacyController = legacyBuilder.install(); TestService current = new TestService(); ServiceBuilder currentBuilder = serviceTarget.addService(ServiceName.of("CURRENT")); SecurityRealm.ServiceUtil.addDependency(currentBuilder, current.injector, TESTNAME); currentBuilder.setInstance(current); ServiceController<?> currentController = currentBuilder.install(); try { container.awaitStability(60, TimeUnit.SECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); Assert.fail("Interrupted"); } Assert.assertEquals(ServiceController.State.UP, realmController.getState()); Assert.assertEquals(ServiceController.State.UP, legacyController.getState()); Assert.assertEquals(ServiceController.State.UP, currentController.getState()); Assert.assertSame(securityRealmService, legacy.getValue()); Assert.assertSame(securityRealmService, current.getValue()); }
Example 15
Source File: HttpManagementAddHandler.java From wildfly-core with GNU Lesser General Public License v2.1 | 4 votes |
@Override protected List<ServiceName> installServices(OperationContext context, HttpInterfaceCommonPolicy commonPolicy, ModelNode model) throws OperationFailedException { final CapabilityServiceTarget serviceTarget = context.getCapabilityServiceTarget(); // Socket-binding reference based config final String socketBindingName = SOCKET_BINDING.resolveModelAttribute(context, model).asStringOrNull(); final String secureSocketBindingName = SECURE_SOCKET_BINDING.resolveModelAttribute(context, model).asStringOrNull(); // Log the config if (socketBindingName != null) { if (secureSocketBindingName != null) { ServerLogger.ROOT_LOGGER.creatingHttpManagementServiceOnSocketAndSecureSocket(socketBindingName, secureSocketBindingName); } else { ServerLogger.ROOT_LOGGER.creatingHttpManagementServiceOnSocket(socketBindingName); } } else if (secureSocketBindingName != null) { ServerLogger.ROOT_LOGGER.creatingHttpManagementServiceOnSecureSocket(secureSocketBindingName); } ConsoleMode consoleMode = consoleMode(commonPolicy.isConsoleEnabled(), context.getRunningMode() == RunningMode.ADMIN_ONLY); // Track active requests final ServiceName requestProcessorName = UndertowHttpManagementService.SERVICE_NAME.append("requests"); HttpManagementRequestsService.installService(requestProcessorName, serviceTarget); NativeManagementServices.installManagementWorkerService(serviceTarget, context.getServiceRegistry(false)); final String httpAuthenticationFactory = commonPolicy.getHttpAuthenticationFactory(); final String securityRealm = commonPolicy.getSecurityRealm(); final String sslContext = commonPolicy.getSSLContext(); if (httpAuthenticationFactory == null && securityRealm == null) { ServerLogger.ROOT_LOGGER.httpManagementInterfaceIsUnsecured(); } ServerEnvironment environment = (ServerEnvironment) context.getServiceRegistry(false).getRequiredService(ServerEnvironmentService.SERVICE_NAME).getValue(); final CapabilityServiceBuilder<?> builder = serviceTarget.addCapability(EXTENSIBLE_HTTP_MANAGEMENT_CAPABILITY); final Consumer<HttpManagement> hmConsumer = builder.provides(EXTENSIBLE_HTTP_MANAGEMENT_CAPABILITY); final Supplier<ListenerRegistry> lrSupplier = builder.requires(RemotingServices.HTTP_LISTENER_REGISTRY); final Supplier<ModelController> mcSupplier = builder.requires(Services.JBOSS_SERVER_CONTROLLER); final Supplier<SocketBinding> sbSupplier = socketBindingName != null ? builder.requiresCapability(SOCKET_BINDING_CAPABILITY_NAME, SocketBinding.class, socketBindingName) : null; final Supplier<SocketBinding> ssbSupplier = secureSocketBindingName != null ? builder.requiresCapability(SOCKET_BINDING_CAPABILITY_NAME, SocketBinding.class, secureSocketBindingName) : null; final Supplier<SocketBindingManager> sbmSupplier = builder.requiresCapability("org.wildfly.management.socket-binding-manager", SocketBindingManager.class); final Supplier<ProcessStateNotifier> cpsnSupplier = builder.requiresCapability("org.wildfly.management.process-state-notifier", ProcessStateNotifier.class); final Supplier<ConsoleAvailability> caSupplier = builder.requiresCapability("org.wildfly.management.console-availability", ConsoleAvailability.class); final Supplier<ManagementHttpRequestProcessor> rpSupplier = builder.requires(requestProcessorName); final Supplier<XnioWorker> xwSupplier = builder.requires(ManagementWorkerService.SERVICE_NAME); final Supplier<Executor> eSupplier = builder.requires(ExternalManagementRequestExecutor.SERVICE_NAME); final Supplier<HttpAuthenticationFactory> hafSupplier = httpAuthenticationFactory != null ? builder.requiresCapability(HTTP_AUTHENTICATION_FACTORY_CAPABILITY, HttpAuthenticationFactory.class, httpAuthenticationFactory) : null; final Supplier<SecurityRealm> srSupplier = securityRealm != null ? SecurityRealm.ServiceUtil.requires(builder, securityRealm) : null; final Supplier<SSLContext> scSupplier = sslContext != null ? builder.requiresCapability(SSL_CONTEXT_CAPABILITY, SSLContext.class, sslContext) : null; final UndertowHttpManagementService undertowService = new UndertowHttpManagementService(hmConsumer, lrSupplier, mcSupplier, sbSupplier, ssbSupplier, sbmSupplier, null, null, cpsnSupplier, rpSupplier, xwSupplier, eSupplier, hafSupplier, srSupplier, scSupplier, null, null, commonPolicy.getAllowedOrigins(), consoleMode, environment.getProductConfig().getConsoleSlot(), commonPolicy.getConstantHeaders(), caSupplier); builder.setInstance(undertowService); builder.install(); // Add service preventing the server from shutting down final ServiceName shutdownName = UndertowHttpManagementService.SERVICE_NAME.append("shutdown"); final ServiceBuilder<?> sb = serviceTarget.addService(shutdownName); final Supplier<Executor> executorSupplier = sb.requires(Services.JBOSS_SERVER_EXECUTOR); final Supplier<ManagementHttpRequestProcessor> processorSupplier = sb.requires(requestProcessorName); final Supplier<ManagementChannelRegistryService> registrySupplier = sb.requires(ManagementChannelRegistryService.SERVICE_NAME); sb.requires(UndertowHttpManagementService.SERVICE_NAME); sb.setInstance(new HttpShutdownService(executorSupplier, processorSupplier, registrySupplier)); sb.install(); if(commonPolicy.isHttpUpgradeEnabled()) { final String hostName = WildFlySecurityManager.getPropertyPrivileged(ServerEnvironment.NODE_NAME, null); NativeManagementServices.installRemotingServicesIfNotInstalled(serviceTarget, hostName, context.getServiceRegistry(false)); final String httpConnectorName; if (socketBindingName != null || (secureSocketBindingName == null)) { httpConnectorName = ManagementRemotingServices.HTTP_CONNECTOR; } else { httpConnectorName = ManagementRemotingServices.HTTPS_CONNECTOR; } RemotingHttpUpgradeService.installServices(context, ManagementRemotingServices.HTTP_CONNECTOR, httpConnectorName, ManagementRemotingServices.MANAGEMENT_ENDPOINT, commonPolicy.getConnectorOptions(), securityRealm, commonPolicy.getSaslAuthenticationFactory()); return Arrays.asList(UndertowHttpManagementService.SERVICE_NAME, HTTP_UPGRADE_REGISTRY.append(httpConnectorName)); } return Collections.singletonList(UndertowHttpManagementService.SERVICE_NAME); }
Example 16
Source File: ContextCreateHandlerRegistryService.java From wildfly-camel with Apache License 2.0 | 4 votes |
public static ServiceController<ContextCreateHandlerRegistry> addService(ServiceTarget serviceTarget, SubsystemState subsystemState) { ContextCreateHandlerRegistryService service = new ContextCreateHandlerRegistryService(subsystemState); ServiceBuilder<ContextCreateHandlerRegistry> builder = serviceTarget.addService(CamelConstants.CONTEXT_CREATE_HANDLER_REGISTRY_SERVICE_NAME, service); return builder.install(); }
Example 17
Source File: ServiceModuleLoader.java From wildfly-core with GNU Lesser General Public License v2.1 | 4 votes |
public static void addService(final ServiceTarget serviceTarget, final Bootstrap.Configuration configuration) { final Service<ServiceModuleLoader> service = new ServiceModuleLoader(configuration.getModuleLoader()); final ServiceBuilder<?> serviceBuilder = serviceTarget.addService(Services.JBOSS_SERVICE_MODULE_LOADER, service); serviceBuilder.install(); }
Example 18
Source File: CamelBootstrapService.java From wildfly-camel with Apache License 2.0 | 4 votes |
public static ServiceController<Void> addService(ServiceTarget serviceTarget) { CamelBootstrapService service = new CamelBootstrapService(); ServiceBuilder<Void> builder = serviceTarget.addService(CamelConstants.CAMEL_SUBSYSTEM_SERVICE_NAME, service); return builder.install(); }
Example 19
Source File: HttpListenerRegistryService.java From wildfly-core with GNU Lesser General Public License v2.1 | 4 votes |
public static void install(final ServiceTarget serviceTarget) { final ServiceBuilder<?> builder = serviceTarget.addService(RemotingServices.HTTP_LISTENER_REGISTRY); final Consumer<ListenerRegistry> serviceConsumer = builder.provides(RemotingServices.HTTP_LISTENER_REGISTRY, SERVICE_NAME); builder.setInstance(new HttpListenerRegistryService(serviceConsumer)); builder.install(); }
Example 20
Source File: ProcessEngineAdd.java From camunda-bpm-platform with Apache License 2.0 | 3 votes |
protected ServiceController<ProcessEngine> installService(OperationContext context, ServiceVerificationHandler verificationHandler, ManagedProcessEngineMetadata processEngineConfiguration) { MscManagedProcessEngineController service = new MscManagedProcessEngineController(processEngineConfiguration); ServiceName name = ServiceNames.forManagedProcessEngine(processEngineConfiguration.getEngineName()); ServiceBuilder<ProcessEngine> serviceBuilder = context.getServiceTarget().addService(name, service); MscManagedProcessEngineController.initializeServiceBuilder(processEngineConfiguration, service, serviceBuilder, processEngineConfiguration.getJobExecutorAcquisitionName()); serviceBuilder.addListener(verificationHandler); return serviceBuilder.install(); }