Search in sources :

Example 1 with DefaultKeyAffinityServiceFactory

use of org.wildfly.clustering.infinispan.spi.affinity.DefaultKeyAffinityServiceFactory in project wildfly by wildfly.

the class KeyAffinityServiceFactoryServiceConfigurator method build.

@Override
public ServiceBuilder<?> build(ServiceTarget target) {
    ServiceName name = this.getServiceName();
    ServiceBuilder<?> builder = target.addService(name);
    Consumer<KeyAffinityServiceFactory> affinityFactory = builder.provides(name);
    Service service = Service.newInstance(affinityFactory, new DefaultKeyAffinityServiceFactory());
    return builder.setInstance(service).setInitialMode(ServiceController.Mode.ON_DEMAND);
}
Also used : ServiceName(org.jboss.msc.service.ServiceName) Service(org.jboss.msc.Service) DefaultKeyAffinityServiceFactory(org.wildfly.clustering.infinispan.spi.affinity.DefaultKeyAffinityServiceFactory) DefaultKeyAffinityServiceFactory(org.wildfly.clustering.infinispan.spi.affinity.DefaultKeyAffinityServiceFactory) KeyAffinityServiceFactory(org.wildfly.clustering.infinispan.spi.affinity.KeyAffinityServiceFactory)

Aggregations

Service (org.jboss.msc.Service)1 ServiceName (org.jboss.msc.service.ServiceName)1 DefaultKeyAffinityServiceFactory (org.wildfly.clustering.infinispan.spi.affinity.DefaultKeyAffinityServiceFactory)1 KeyAffinityServiceFactory (org.wildfly.clustering.infinispan.spi.affinity.KeyAffinityServiceFactory)1