Search in sources :

Example 6 with ServiceConfigurator

use of org.wildfly.clustering.service.ServiceConfigurator in project wildfly by wildfly.

the class SingletonPolicyServiceHandler method installServices.

@Override
public void installServices(OperationContext context, ModelNode model) throws OperationFailedException {
    PathAddress address = context.getCurrentAddress();
    ServiceTarget target = context.getServiceTarget();
    ServiceConfigurator configurator = new SingletonPolicyServiceConfigurator(address, this.registry).configure(context, model);
    configurator.build(target).install();
    // Use legacy service installation for legacy capability
    new AliasServiceBuilder<>(LEGACY_POLICY.getServiceName(address), configurator.getServiceName(), SingletonRequirement.SINGLETON_POLICY.getType()).build(target).install();
}
Also used : PathAddress(org.jboss.as.controller.PathAddress) ServiceTarget(org.jboss.msc.service.ServiceTarget) ServiceConfigurator(org.wildfly.clustering.service.ServiceConfigurator)

Example 7 with ServiceConfigurator

use of org.wildfly.clustering.service.ServiceConfigurator in project wildfly by wildfly.

the class InfinispanSessionManagerFactoryServiceConfigurator method build.

@Override
public ServiceBuilder<?> build(ServiceTarget target) {
    this.configurationConfigurator.build(target).install();
    this.cacheConfigurator.build(target).install();
    for (ServiceConfigurator configurator : this.configurators) {
        configurator.build(target).install();
    }
    ServiceBuilder<?> builder = target.addService(this.getServiceName());
    Consumer<SessionManagerFactory<SC, LC, TransactionBatch>> factory = new CompositeDependency(this.group, this.affinityFactory, this.dispatcherFactory).register(builder).provides(this.getServiceName());
    this.cache = builder.requires(this.cacheConfigurator.getServiceName());
    Service service = new FunctionalService<>(factory, Function.identity(), this, Consumers.close());
    return builder.setInstance(service).setInitialMode(ServiceController.Mode.ON_DEMAND);
}
Also used : FunctionalService(org.wildfly.clustering.service.FunctionalService) SessionManagerFactory(org.wildfly.clustering.web.session.SessionManagerFactory) Service(org.jboss.msc.Service) FunctionalService(org.wildfly.clustering.service.FunctionalService) CompositeDependency(org.wildfly.clustering.service.CompositeDependency) ServiceConfigurator(org.wildfly.clustering.service.ServiceConfigurator) TemplateConfigurationServiceConfigurator(org.wildfly.clustering.infinispan.spi.service.TemplateConfigurationServiceConfigurator) CacheServiceConfigurator(org.wildfly.clustering.infinispan.spi.service.CacheServiceConfigurator) CapabilityServiceConfigurator(org.jboss.as.clustering.controller.CapabilityServiceConfigurator)

Aggregations

ServiceConfigurator (org.wildfly.clustering.service.ServiceConfigurator)7 ServiceTarget (org.jboss.msc.service.ServiceTarget)6 CapabilityServiceConfigurator (org.jboss.as.clustering.controller.CapabilityServiceConfigurator)3 PathAddress (org.jboss.as.controller.PathAddress)3 ModelNode (org.jboss.dmr.ModelNode)3 ServiceValueCaptorServiceConfigurator (org.jboss.as.clustering.controller.ServiceValueCaptorServiceConfigurator)2 ServiceSupplierDependency (org.wildfly.clustering.service.ServiceSupplierDependency)2 HashSet (java.util.HashSet)1 Map (java.util.Map)1 Entry (java.util.Map.Entry)1 ModulesServiceConfigurator (org.jboss.as.clustering.controller.ModulesServiceConfigurator)1 BinderServiceConfigurator (org.jboss.as.clustering.naming.BinderServiceConfigurator)1 CapabilityServiceBuilder (org.jboss.as.controller.CapabilityServiceBuilder)1 CapabilityServiceSupport (org.jboss.as.controller.capability.CapabilityServiceSupport)1 Resource (org.jboss.as.controller.registry.Resource)1 CacheFactoryBuilderServiceNameProvider (org.jboss.as.ejb3.cache.CacheFactoryBuilderServiceNameProvider)1 DistributableCacheFactoryBuilderServiceNameProvider (org.jboss.as.ejb3.cache.distributable.DistributableCacheFactoryBuilderServiceNameProvider)1 SimpleCacheFactoryBuilderServiceConfigurator (org.jboss.as.ejb3.cache.simple.SimpleCacheFactoryBuilderServiceConfigurator)1 EJBRemoteConnectorService (org.jboss.as.ejb3.remote.EJBRemoteConnectorService)1 EJBRemotingConnectorClientMappingsEntryProviderService (org.jboss.as.ejb3.remote.EJBRemotingConnectorClientMappingsEntryProviderService)1