public ServiceBuilder<T> build(ServiceContainer target, String container) {
ServiceName registryName = ServiceProviderRegistryService.getServiceName(container);
synchronized (target) {
if (target.getService(registryName) == null) {
new ServiceProviderRegistryService().build(target, container).setInitialMode(ServiceController.Mode.ON_DEMAND).install();
}
}
return target.addService(this.serviceName, this)
.addDependency(ServiceProviderRegistryService.getServiceName(container), ServiceProviderRegistry.class, this.registryRef)
.addDependency(ServiceName.JBOSS.append(DEFAULT_CONTAINER, container), GroupRpcDispatcher.class, this.dispatcherRef)