}
})
.addAliases(DomainControllerConnection.SERVICE_NAME)
.setInitialMode(ServiceController.Mode.ACTIVE);
HostModel hostConfig = getHostModel();
final RemoteDomainControllerElement remoteDomainControllerElement = hostConfig.getRemoteDomainControllerElement();
final InetAddress hostAddress;
try {
hostAddress = InetAddress.getByName(remoteDomainControllerElement.getHost());
} catch (UnknownHostException e) {
throw new RuntimeException("Failed to get remote domain controller address", e);
}
serviceBuilder.addInjection(domainControllerClientService.getDomainControllerAddressInjector(), hostAddress);
serviceBuilder.addInjection(domainControllerClientService.getDomainControllerPortInjector(), remoteDomainControllerElement.getPort());
final ManagementElement managementElement = hostConfig.getManagementElement();
serviceBuilder.addDependency(NetworkInterfaceService.JBOSS_NETWORK_INTERFACE.append(managementElement.getInterfaceName()), NetworkInterfaceBinding.class, domainControllerClientService.getLocalManagementInterfaceInjector());
serviceBuilder.addInjection(domainControllerClientService.getLocalManagementPortInjector(), managementElement.getPort());
serviceBuilder.addDependency(SERVICE_NAME_BASE.append("executor"), ScheduledExecutorService.class, domainControllerClientService.getExecutorServiceInjector());
serviceBuilder.addDependency(SERVICE_NAME_BASE.append("thread-factory"), ThreadFactory.class, domainControllerClientService.getThreadFactoryInjector());
}