org.zodiac.eureka.client.util.EurekaClientHolder Maven / Gradle / Ivy
package org.zodiac.eureka.client.util;
import java.util.Map;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.function.Function;
import java.util.function.Supplier;
import java.util.stream.Collectors;
import org.slf4j.Logger;
import org.zodiac.commons.logging.SmartSlf4jLoggerFactory;
import org.zodiac.core.application.AppContext;
import org.zodiac.core.application.AppEnvType;
import org.zodiac.core.application.AppInstance;
import org.zodiac.core.application.ApplicationInfo;
import org.zodiac.sdk.toolkit.util.ExceptionUtil;
import org.zodiac.sdk.toolkit.util.lang.StrUtil;
public abstract class EurekaClientHolder {
private EurekaClientHolder() {
super();
}
private static final Logger LOG = SmartSlf4jLoggerFactory.getLogger(EurekaClientHolder.class);
private static volatile AtomicBoolean initialized = new AtomicBoolean(false);
private static final Map SERVER_MAP;
private static final Function DEFAULT_SERVER_MAPPER = (value) -> "http://localhost:8761";
static {
SERVER_MAP = AppEnvType.envTypes().stream().collect(Collectors.toMap(envType -> envType, DEFAULT_SERVER_MAPPER));
}
public static void initialize(Supplier
© 2015 - 2025 Weber Informatics LLC | Privacy Policy