use of org.wildfly.clustering.singleton.SingletonServiceBuilderFactory in project wildfly by wildfly.
the class SingletonServiceActivator method activate.
@Override
public void activate(ServiceActivatorContext context) {
try {
SingletonServiceBuilderFactory factory = (SingletonServiceBuilderFactory) context.getServiceRegistry().getRequiredService(SingletonServiceName.BUILDER.getServiceName(CONTAINER_NAME)).awaitValue();
ServiceTarget target = context.getServiceTarget();
install(target, factory, SERVICE_A_NAME, SERVICE_A_PREFERRED_NODE);
install(target, factory, SERVICE_B_NAME, SERVICE_B_PREFERRED_NODE);
} catch (InterruptedException e) {
throw new ServiceRegistryException(e);
}
}
use of org.wildfly.clustering.singleton.SingletonServiceBuilderFactory in project wildfly by wildfly.
the class NodeServiceActivator method activate.
@Override
public void activate(ServiceActivatorContext context) {
ServiceTarget target = context.getServiceTarget();
try {
SingletonServiceBuilderFactory factory = (SingletonServiceBuilderFactory) context.getServiceRegistry().getRequiredService(ServiceName.parse(SingletonDefaultCacheRequirement.SINGLETON_SERVICE_BUILDER_FACTORY.resolve(CONTAINER_NAME))).awaitValue();
install(target, factory, DEFAULT_SERVICE_NAME, 1);
install(target, factory, QUORUM_SERVICE_NAME, 2);
} catch (InterruptedException e) {
throw new ServiceRegistryException(e);
}
}
Aggregations