public ModuleIdentifier addExternalModule(String externalModule) { ModuleIdentifier identifier = ModuleIdentifier.create(EXTERNAL_MODULE_PREFIX + externalModule); ServiceName serviceName = ServiceModuleLoader.moduleSpecServiceName(identifier); ServiceController<?> controller = serviceContainer.getService(serviceName); if (controller == null) { ExternalModuleSpecService service = new ExternalModuleSpecService(identifier, new File(externalModule)); serviceContainer.addService(serviceName, service).setInitialMode(Mode.ON_DEMAND).install(); } return identifier; }
public ModuleIdentifier addExternalModule(String externalModule) { ModuleIdentifier identifier = ModuleIdentifier.create(EXTERNAL_MODULE_PREFIX + externalModule); ServiceName serviceName = ServiceModuleLoader.moduleSpecServiceName(identifier); ServiceController<?> controller = serviceContainer.getService(serviceName); if (controller == null) { ExternalModuleSpecService service = new ExternalModuleSpecService(identifier, new File(externalModule)); serviceContainer.addService(serviceName, service).setInitialMode(Mode.ON_DEMAND).install(); } return identifier; }
public ModuleIdentifier addExternalModule(String externalModule) { ModuleIdentifier identifier = ModuleIdentifier.create(EXTERNAL_MODULE_PREFIX + externalModule); ServiceName serviceName = ServiceModuleLoader.moduleSpecServiceName(identifier); ServiceController<?> controller = serviceContainer.getService(serviceName); if (controller == null) { ExternalModuleSpecService service = new ExternalModuleSpecService(identifier, new File(externalModule)); serviceContainer.addService(serviceName, service).setInitialMode(Mode.ON_DEMAND).install(); } return identifier; }
public ModuleIdentifier addExternalModule(String externalModule) { ModuleIdentifier identifier = ModuleIdentifier.create(EXTERNAL_MODULE_PREFIX + externalModule); ServiceName serviceName = ServiceModuleLoader.moduleSpecServiceName(identifier); ServiceController<?> controller = serviceContainer.getService(serviceName); if (controller == null) { ExternalModuleSpecService service = new ExternalModuleSpecService(identifier, new File(externalModule)); serviceContainer.addService(serviceName, service).setInitialMode(Mode.ON_DEMAND).install(); } return identifier; }
@Override protected EmbeddedCacheManager createCacheManager(Properties properties) throws CacheException { // Find a suitable service name to represent this session factory instance String name = properties.getProperty(Environment.SESSION_FACTORY_NAME); this.serviceName = ServiceName.JBOSS.append(DEFAULT_CACHE_CONTAINER, (name != null) ? name : UUID.randomUUID().toString()); String container = properties.getProperty(CACHE_CONTAINER, DEFAULT_CACHE_CONTAINER); ServiceContainer target = ServiceContainerHelper.getCurrentServiceContainer(); InjectedValue<EmbeddedCacheManager> manager = new InjectedValue<EmbeddedCacheManager>(); ServiceBuilder<EmbeddedCacheManager> builder = target.addService(this.serviceName, new ValueService<EmbeddedCacheManager>(manager)) .addDependency(EmbeddedCacheManagerService.getServiceName(container), EmbeddedCacheManager.class, manager) .setInitialMode(ServiceController.Mode.ACTIVE) ; HibernateSecondLevelCache.addSecondLevelCacheDependencies(target, target, builder, new HibernateMetaData(properties)); try { return ServiceContainerHelper.getValue(builder.install()); } catch (StartException e) { throw new CacheException(e); } }
@Override protected EmbeddedCacheManager createCacheManager(Properties properties) throws CacheException { // Find a suitable service name to represent this session factory instance String name = properties.getProperty(AvailableSettings.SESSION_FACTORY_NAME); this.serviceName = ServiceName.JBOSS.append(DEFAULT_CACHE_CONTAINER, (name != null) ? name : UUID.randomUUID().toString()); String container = properties.getProperty(CACHE_CONTAINER, DEFAULT_CACHE_CONTAINER); ServiceContainer target = ServiceContainerHelper.getCurrentServiceContainer(); // Create a mock service that represents this session factory instance InjectedValue<EmbeddedCacheManager> manager = new InjectedValue<EmbeddedCacheManager>(); ServiceBuilder<EmbeddedCacheManager> builder = target.addService(this.serviceName, new ValueService<EmbeddedCacheManager>(manager)) .addDependency(EmbeddedCacheManagerService.getServiceName(container), EmbeddedCacheManager.class, manager) .setInitialMode(ServiceController.Mode.ACTIVE) ; HibernateSecondLevelCache.addSecondLevelCacheDependencies(target, target, builder, new HibernateMetaData(properties)); try { return ServiceContainerHelper.getValue(builder.install()); } catch (StartException e) { throw new CacheException(e); } }
.addService(processEngineServiceBindingServiceName, processEngineServiceBinder); processEngineServiceBuilder.addDependency(ContextNames.GLOBAL_CONTEXT_SERVICE_NAME, ServiceBasedNamingStore.class, processEngineServiceBinder.getNamingStoreInjector()); processEngineServiceBinder.getManagedObjectInjector().inject(new PlatformServiceReferenceFactory(this)); ServiceBuilder<ManagedReferenceFactory> processArchiveServiceBuilder = serviceContainer.addService(processArchiveServiceBindingServiceName, processArchiveServiceBinder); processArchiveServiceBuilder.addDependency(ContextNames.GLOBAL_CONTEXT_SERVICE_NAME, ServiceBasedNamingStore.class, processArchiveServiceBinder.getNamingStoreInjector()); processArchiveServiceBinder.getManagedObjectInjector().inject(new PlatformServiceReferenceFactory(this));
serviceContainer.addService(ServiceModuleLoader.moduleSpecServiceName(moduleIdentifier), service) .addDependency(org.jboss.as.server.deployment.Services.JBOSS_DEPLOYMENT_EXTENSION_INDEX) .setInitialMode(Mode.ON_DEMAND).install();
serviceContainer.addService(serviceName, service) .addDependency(org.jboss.as.server.deployment.Services.JBOSS_DEPLOYMENT_EXTENSION_INDEX) .setInitialMode(Mode.ON_DEMAND).install();
public Future<ProcessEngineStartOperation> startProcessEngine(ProcessEngineConfiguration processEngineConfiguration) { final ContainerProcessEngineController processEngineController = new ContainerProcessEngineController(processEngineConfiguration); final ContextNames.BindInfo datasourceBindInfo = ContextNames.bindInfoFor(processEngineConfiguration.getDatasourceJndiName()); final ServiceListenerFuture<ContainerProcessEngineController, ProcessEngineStartOperation> listener = new ServiceListenerFuture<ContainerProcessEngineController, ProcessEngineStartOperation>(processEngineController) { protected void serviceAvailable() { this.value = new ProcessEngineStartOperationImpl(serviceInstance.getProcessEngine()); } }; serviceContainer.addService(ContainerProcessEngineController.createServiceName(processEngineConfiguration.getProcessEngineName()), processEngineController) .addDependency(ServiceName.JBOSS.append("txn").append("TransactionManager"), TransactionManager.class, processEngineController.getTransactionManagerInjector()) .addDependency(datasourceBindInfo.getBinderServiceName(), DataSourceReferenceFactoryService.class, processEngineController.getDatasourceBinderServiceInjector()) .addDependency(getServiceName(), ContainerPlatformService.class, processEngineController.getContainerPlatformServiceInjector()) .setInitialMode(Mode.ACTIVE) .addListener(listener) .install(); return listener; }
ServiceBuilder<?> builder = target.addService(ServiceName.JBOSS.append(DEFAULT_CACHE_CONTAINER, name)); Supplier<EmbeddedCacheManager> manager = builder.requires(containerServiceName);
ServiceBuilder<?> builder = target.addService(ServiceName.JBOSS.append(DEFAULT_CACHE_CONTAINER, name)); Supplier<EmbeddedCacheManager> manager = builder.requires(containerServiceName);
private void publishPartitionManager(StartContext context) { BindInfo bindInfo = createPartitionManagerBindInfo(); ServiceName serviceName = bindInfo.getBinderServiceName(); final BinderService binderService = new BinderService(serviceName.getCanonicalName()); final ServiceBuilder<ManagedReferenceFactory> builder = context.getController().getServiceContainer() .addService(serviceName, binderService).addAliases(ContextNames.JAVA_CONTEXT_SERVICE_NAME.append(jndiName)); builder.addDependency(ContextNames.JAVA_CONTEXT_SERVICE_NAME, ServiceBasedNamingStore.class, binderService.getNamingStoreInjector()); builder.addDependency(createServiceName(this.alias), PartitionManager.class, new Injector<PartitionManager>() { @Override public void inject(final PartitionManager value) throws InjectionException { binderService.getManagedObjectInjector().inject( new ValueManagedReferenceFactory(new ImmediateValue<Object>(value))); } @Override public void uninject() { binderService.getManagedObjectInjector().uninject(); } }); builder.setInitialMode(Mode.PASSIVE).install(); ROOT_LOGGER.boundToJndi("PartitionManager " + this.alias, bindInfo.getAbsoluteJndiName()); }
this.deployer.debug(this.debug); this.serviceContainer.addService(ServiceName.of("swarm", "deployer"), new ValueService<>(new ImmediateValue<Object>(this.deployer))).install();
public void activated() { if (overrideInVMSecurity) { activeMQServer.getValue().getRemotingService().allowInvmSecurityOverride(new ActiveMQPrincipal(DefaultCredentials.getUsername(), DefaultCredentials.getPassword())); } // ActiveMQ only provides a callback to be notified when ActiveMQ core server is activated. // but the JMS service start must not be completed until the JMSServerManager wrappee is indeed started (and has deployed the JMS resources, etc.). // It is possible that the activation service has already been installed but becomes passive when a backup server has failed over (-> ACTIVE) and failed back (-> PASSIVE) // [WFLY-6178] check if the service container is shutdown to avoid an IllegalStateException if an // ActiveMQ backup server is activated during failover while the WildFly server is shutting down. if (serviceContainer.isShutdown()) { return; } if (activeMQActivationController == null) { activeMQActivationController = serviceContainer.addService(ActiveMQActivationService.getServiceName(serverServiceName), new ActiveMQActivationService()) .setInitialMode(Mode.ACTIVE) .install(); } else { activeMQActivationController.setMode(ACTIVE); } }
public void activated() { if (overrideInVMSecurity) { activeMQServer.getValue().getRemotingService().allowInvmSecurityOverride(new ActiveMQPrincipal(DefaultCredentials.getUsername(), DefaultCredentials.getPassword())); } // ActiveMQ only provides a callback to be notified when ActiveMQ core server is activated. // but the JMS service start must not be completed until the JMSServerManager wrappee is indeed started (and has deployed the JMS resources, etc.). // It is possible that the activation service has already been installed but becomes passive when a backup server has failed over (-> ACTIVE) and failed back (-> PASSIVE) // [WFLY-6178] check if the service container is shutdown to avoid an IllegalStateException if an // ActiveMQ backup server is activated during failover while the WildFly server is shutting down. if (serviceContainer.isShutdown()) { return; } if (activeMQActivationController == null) { activeMQActivationController = serviceContainer.addService(ActiveMQActivationService.getServiceName(serverServiceName), new ActiveMQActivationService()) .setInitialMode(Mode.ACTIVE) .install(); } else { activeMQActivationController.setMode(ACTIVE); } }
serviceContainer.addService(ServiceName.of("swarm", "deployer"), new ValueService<>(new ImmediateValue<Deployer>(deployer))).install();
serviceContainer.addService(ServiceName.of("thorntail", "deployer"), new ValueService<>(new ImmediateValue<>(deployer))).install();
service = new BinderService(bindInfo.getBindName(), bindingConfiguration.getSource()); dependencies.add(bindInfo.getBinderServiceName()); ServiceBuilder<ManagedReferenceFactory> serviceBuilder = CurrentServiceContainer.getServiceContainer().addService(bindInfo.getBinderServiceName(), service); bindingConfiguration.getSource().getResourceValue(resolutionContext, serviceBuilder, phaseContext, service.getManagedObjectInjector()); serviceBuilder.addDependency(bindInfo.getParentContextServiceName(), ServiceBasedNamingStore.class, service.getNamingStoreInjector());
serviceContainer.addService(serviceName, processArchiveService) .addDependency(processEngineServiceName, ContainerProcessEngineController.class, processArchiveService.getProcessEngineControllerInjector()) .addDependency(ContainerPlatformService.getServiceName(), ContainerPlatformService.class, processArchiveService.getContainerPlatformServiceInjector())