List<Integer> allocateService(DeployLogger deployLogger, AbstractService service, int wantedPort) {
        ports().useLogger(deployLogger);
        List<Integer> ports = hostPorts.allocatePorts(service, wantedPort);
        if (getService(service.getServiceName()) != null)
            throw new IllegalStateException("There is already a service with name '" + service.getServiceName() +
                                            "' registered on " + this + ". " +
                                            "Most likely a programming error - " +
                                            "all service classes must have unique names, even in different packages!");

        services.put(service.getServiceName(), service);
        return ports;
    }
Adds service and allocates resources for it.

@param service the Service to allocate resources for
@param wantedPort the wanted port for this service
@return the allocated ports for the Service.
config-model/src/main/java/com/yahoo/vespa/model/HostResource.java