use of org.jboss.msc.service.DelegatingServiceContainer in project eap-additional-testsuite by jboss-set.
the class HATimerServiceActivator method activate.
@Override
public void activate(ServiceActivatorContext context) {
log.info("HATimerService will be installed!");
HATimerService service = new HATimerService();
ServiceName factoryServiceName = SingletonServiceName.BUILDER.getServiceName("server", "default");
ServiceController<?> factoryService = context.getServiceRegistry().getRequiredService(factoryServiceName);
SingletonServiceBuilderFactory factory = (SingletonServiceBuilderFactory) factoryService.getValue();
factory.createSingletonServiceBuilder(HATimerService.SINGLETON_SERVICE_NAME, service).electionPolicy(new PreferredSingletonElectionPolicy(new SimpleSingletonElectionPolicy(), new NamePreference("node1/singleton"))).build(new DelegatingServiceContainer(context.getServiceTarget(), context.getServiceRegistry())).setInitialMode(ServiceController.Mode.ACTIVE).install();
}
use of org.jboss.msc.service.DelegatingServiceContainer in project eap-additional-testsuite by jboss-set.
the class HATimerServiceActivator4 method activate.
@Override
public void activate(ServiceActivatorContext context) {
log.info("HATimerService 4 will be installed!");
HATimerService4 service = new HATimerService4();
ServiceName factoryServiceName = SingletonServiceName.BUILDER.getServiceName("server", "default");
ServiceController<?> factoryService = context.getServiceRegistry().getRequiredService(factoryServiceName);
SingletonServiceBuilderFactory factory = (SingletonServiceBuilderFactory) factoryService.getValue();
factory.createSingletonServiceBuilder(HATimerService4.SINGLETON_SERVICE_NAME4, service).electionPolicy(new PreferredSingletonElectionPolicy(new SimpleSingletonElectionPolicy(), new NamePreference("node1/singleton"))).build(new DelegatingServiceContainer(context.getServiceTarget(), context.getServiceRegistry())).setInitialMode(ServiceController.Mode.ACTIVE).install();
}
use of org.jboss.msc.service.DelegatingServiceContainer in project eap-additional-testsuite by jboss-set.
the class HATimerServiceActivator2 method activate.
@Override
public void activate(ServiceActivatorContext context) {
log.info("HATimerService 2 will be installed!");
HATimerService2 service = new HATimerService2();
ServiceName factoryServiceName = SingletonServiceName.BUILDER.getServiceName("server", "default");
ServiceController<?> factoryService = context.getServiceRegistry().getRequiredService(factoryServiceName);
SingletonServiceBuilderFactory factory = (SingletonServiceBuilderFactory) factoryService.getValue();
factory.createSingletonServiceBuilder(HATimerService2.SINGLETON_SERVICE_NAME2, service).electionPolicy(new PreferredSingletonElectionPolicy(new SimpleSingletonElectionPolicy(), new NamePreference("node1/singleton"))).build(new DelegatingServiceContainer(context.getServiceTarget(), context.getServiceRegistry())).setInitialMode(ServiceController.Mode.ACTIVE).install();
}
use of org.jboss.msc.service.DelegatingServiceContainer in project eap-additional-testsuite by jboss-set.
the class HATimerServiceActivator3 method activate.
@Override
public void activate(ServiceActivatorContext context) {
log.info("HATimerService 3 will be installed!");
HATimerService3 service = new HATimerService3();
ServiceName factoryServiceName = SingletonServiceName.BUILDER.getServiceName("server", "default");
ServiceController<?> factoryService = context.getServiceRegistry().getRequiredService(factoryServiceName);
SingletonServiceBuilderFactory factory = (SingletonServiceBuilderFactory) factoryService.getValue();
factory.createSingletonServiceBuilder(HATimerService3.SINGLETON_SERVICE_NAME3, service).electionPolicy(new PreferredSingletonElectionPolicy(new SimpleSingletonElectionPolicy(), new NamePreference("node1/singleton"))).build(new DelegatingServiceContainer(context.getServiceTarget(), context.getServiceRegistry())).setInitialMode(ServiceController.Mode.ACTIVE).install();
}
Aggregations