endpointName = RemotingServices.SUBSYSTEM_ENDPOINT;
}
final int port = managementSocket.getPort();
final String host = NetworkUtils.formatPossibleIpv6Address(managementSocket.getAddress().getHostAddress());
final HostControllerServerClient client = new HostControllerServerClient(serverName, serverProcessName, host, port, authKey);
serviceTarget.addService(HostControllerServerClient.SERVICE_NAME, client)
.addDependency(endpointName, Endpoint.class, client.getEndpointInjector())
.addDependency(Services.JBOSS_SERVER_CONTROLLER, ModelController.class, client.getServerControllerInjector())
.addDependency(RemoteFileRepository.SERVICE_NAME, RemoteFileRepository.class, client.getRemoteFileRepositoryInjector())
.setInitialMode(ServiceController.Mode.ACTIVE)
.install();
}