All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.netflix.niws.loadbalancer.LegacyEurekaClientProvider Maven / Gradle / Ivy

There is a newer version: 2.7.18
Show newest version
package com.netflix.niws.loadbalancer;

import com.netflix.discovery.DiscoveryManager;
import com.netflix.discovery.EurekaClient;

import javax.inject.Provider;

/**
 * A legacy class to provide eurekaclient via static singletons
 */
class LegacyEurekaClientProvider implements Provider {

    private volatile EurekaClient eurekaClient;

    @Override
    public synchronized EurekaClient get() {
        if (eurekaClient == null) {
            eurekaClient = DiscoveryManager.getInstance().getDiscoveryClient();
        }

        return eurekaClient;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy