use of org.jboss.as.test.clustering.cluster.singleton.service.SingletonElectionListenerService in project wildfly by wildfly.
the class SingletonServiceActivator method install.
private static void install(ServiceTarget target, SingletonServiceConfiguratorFactory factory, ServiceName name, String preferredNode) {
ServiceBuilder<?> builder = target.addService(name);
SingletonElectionListenerService listenerService = new SingletonElectionListenerService(builder.provides(name));
builder.setInstance(listenerService).install();
factory.createSingletonServiceConfigurator(name.append("singleton")).electionPolicy(new PreferredSingletonElectionPolicy(new SimpleSingletonElectionPolicy(), new NamePreference(preferredNode))).electionListener(listenerService).build(target).install();
}
Aggregations