@Override
    public void initWithNiwsConfig(IClientConfig clientConfig) {
        clientName = clientConfig.getClientName();
        vipAddresses = clientConfig.resolveDeploymentContextbasedVipAddresses();
        if (vipAddresses == null &&
                ConfigurationManager.getConfigInstance().getBoolean("DiscoveryEnabledNIWSServerList.failFastOnNullVip", true)) {
            throw new NullPointerException("VIP address for client " + clientName + " is null");
        }
        isSecure = clientConfig.get(CommonClientConfigKey.IsSecure, false);
        prioritizeVipAddressBasedServers = clientConfig.get(CommonClientConfigKey.PrioritizeVipAddressBasedServers, prioritizeVipAddressBasedServers);
        datacenter = ConfigurationManager.getDeploymentContext().getDeploymentDatacenter();
        targetRegion = clientConfig.get(CommonClientConfigKey.TargetRegion);

        shouldUseIpAddr = clientConfig.getOrDefault(CommonClientConfigKey.UseIPAddrForServer);

        // override client configuration and use client-defined port
        if (clientConfig.get(CommonClientConfigKey.ForceClientPortConfiguration, false)) {
            if (isSecure) {
                final Integer port = clientConfig.get(CommonClientConfigKey.SecurePort);
                if (port != null) {
                    overridePort = port;
                    shouldUseOverridePort = true;
                } else {
                    logger.warn(clientName + " set to force client port but no secure port is set, so ignoring");
                }
            } else {
                final Integer port = clientConfig.get(CommonClientConfigKey.Port);
                if (port != null) {
                    overridePort = port;
                    shouldUseOverridePort = true;
                } else{
                    logger.warn(clientName + " set to force client port but no port is set, so ignoring");
                }
            }
        }
    }
@deprecated
use {@link #DiscoveryEnabledNIWSServerList(com.netflix.client.config.IClientConfig, javax.inject.Provider)}
@param clientConfig
ribbon-eureka/src/main/java/com/netflix/niws/loadbalancer/DiscoveryEnabledNIWSServerList.java