Search in sources :

Example 1 with SingletonServiceConfiguratorFactory

use of org.wildfly.clustering.singleton.service.SingletonServiceConfiguratorFactory in project wildfly by wildfly.

the class LocalSingletonServiceConfiguratorFactoryServiceConfigurator method build.

@Override
public ServiceBuilder<?> build(ServiceTarget target) {
    ServiceBuilder<?> builder = target.addService(this.getServiceName());
    Consumer<SingletonServiceConfiguratorFactory> factory = builder.provides(this.getServiceName());
    Service service = Service.newInstance(factory, new LocalSingletonServiceBuilderFactory(this));
    return builder.setInstance(service);
}
Also used : Service(org.jboss.msc.Service) SingletonServiceConfiguratorFactory(org.wildfly.clustering.singleton.service.SingletonServiceConfiguratorFactory)

Example 2 with SingletonServiceConfiguratorFactory

use of org.wildfly.clustering.singleton.service.SingletonServiceConfiguratorFactory in project wildfly by wildfly.

the class CacheSingletonServiceConfiguratorFactoryServiceConfigurator method build.

@Override
public ServiceBuilder<?> build(ServiceTarget target) {
    ServiceBuilder<?> builder = target.addService(this.getServiceName());
    Consumer<SingletonServiceConfiguratorFactory> factory = builder.provides(this.getServiceName());
    @SuppressWarnings("deprecation") Service service = Service.newInstance(factory, new DistributedSingletonServiceBuilderFactory(this));
    return builder.setInstance(service);
}
Also used : Service(org.jboss.msc.Service) SingletonServiceConfiguratorFactory(org.wildfly.clustering.singleton.service.SingletonServiceConfiguratorFactory)

Aggregations

Service (org.jboss.msc.Service)2 SingletonServiceConfiguratorFactory (org.wildfly.clustering.singleton.service.SingletonServiceConfiguratorFactory)2