Example #1
0
 @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);
   }
 }
 @Override
 public void activate(ServiceActivatorContext context) throws ServiceRegistryException {
   final GateInWCIService service = new GateInWCIService();
   final ServiceBuilder<GateInWCIService> serviceBuilder =
       context
           .getServiceTarget()
           .addService(GateInWCIService.NAME, service)
           .addDependency(WebSubsystemServices.JBOSS_WEB, WebServer.class, service.getWebServer())
           .setInitialMode(ServiceController.Mode.ACTIVE);
   serviceBuilder.install();
 }