@Override public void run() { boolean alreadyBound = false; try { alreadyBound = alreadyBound(); // If the ip is not bound, the registry could be stale. First sync up the registry from the // neighboring node before trying to bind the IP if (!alreadyBound) { registry.clearRegistry(); int count = registry.syncUp(); registry.openForTraffic(applicationInfoManager, count); } else { // An ip is already bound return; } bind(); } catch (Throwable e) { logger.error("Could not bind to IP", e); } finally { if (alreadyBound) { timer.schedule(new IPBindingTask(), serverConfig.getEIPBindingRetryIntervalMs()); } else { timer.schedule(new IPBindingTask(), serverConfig.getEIPBindingRetryIntervalMsWhenUnbound()); } } } }
@Override public void run() { boolean isEIPBound = false; try { isEIPBound = isEIPBound(); // If the EIP is not bound, the registry could be stale. First sync up the registry from the // neighboring node before trying to bind the EIP if (!isEIPBound) { registry.clearRegistry(); int count = registry.syncUp(); registry.openForTraffic(applicationInfoManager, count); } else { // An EIP is already bound return; } bindEIP(); } catch (Throwable e) { logger.error("Could not bind to EIP", e); } finally { if (isEIPBound) { timer.schedule(new EIPBindingTask(), serverConfig.getEIPBindingRetryIntervalMs()); } else { timer.schedule(new EIPBindingTask(), serverConfig.getEIPBindingRetryIntervalMsWhenUnbound()); } } } };
registry.openForTraffic(applicationInfoManager, registryCount);
@Override public void run() { boolean isEIPBound = false; try { isEIPBound = isEIPBound(); // If the EIP is not bound, the registry could be stale. First sync up the registry from the // neighboring node before trying to bind the EIP if (!isEIPBound) { registry.clearRegistry(); int count = registry.syncUp(); registry.openForTraffic(applicationInfoManager, count); } else { // An EIP is already bound return; } bindEIP(); } catch (Throwable e) { logger.error("Could not bind to EIP", e); } finally { if (isEIPBound) { timer.schedule(new EIPBindingTask(), serverConfig.getEIPBindingRetryIntervalMs()); } else { timer.schedule(new EIPBindingTask(), serverConfig.getEIPBindingRetryIntervalMsWhenUnbound()); } } } };
@Override public void run() { boolean alreadyBound = false; try { alreadyBound = alreadyBound(); // If the ip is not bound, the registry could be stale. First sync up the registry from the // neighboring node before trying to bind the IP if (!alreadyBound) { registry.clearRegistry(); int count = registry.syncUp(); registry.openForTraffic(applicationInfoManager, count); } else { // An ip is already bound return; } bind(); } catch (Throwable e) { logger.error("Could not bind to IP", e); } finally { if (alreadyBound) { timer.schedule(new IPBindingTask(), serverConfig.getEIPBindingRetryIntervalMs()); } else { timer.schedule(new IPBindingTask(), serverConfig.getEIPBindingRetryIntervalMsWhenUnbound()); } } } }
protected void initEurekaServerContext() throws Exception { // For backward compatibility JsonXStream.getInstance().registerConverter(new V1AwareInstanceInfoConverter(), XStream.PRIORITY_VERY_HIGH); XmlXStream.getInstance().registerConverter(new V1AwareInstanceInfoConverter(), XStream.PRIORITY_VERY_HIGH); if (isAws(this.applicationInfoManager.getInfo())) { this.awsBinder = new AwsBinderDelegate(this.eurekaServerConfig, this.eurekaClientConfig, this.registry, this.applicationInfoManager); this.awsBinder.start(); } EurekaServerContextHolder.initialize(this.serverContext); log.info("Initialized server context"); // Copy registry from neighboring eureka node int registryCount = this.registry.syncUp(); this.registry.openForTraffic(this.applicationInfoManager, registryCount); // Register all monitoring statistics. EurekaMonitors.registerAllStats(); }
protected void initEurekaServerContext() throws Exception { // For backward compatibility JsonXStream.getInstance().registerConverter(new V1AwareInstanceInfoConverter(), XStream.PRIORITY_VERY_HIGH); XmlXStream.getInstance().registerConverter(new V1AwareInstanceInfoConverter(), XStream.PRIORITY_VERY_HIGH); if (isAws(this.applicationInfoManager.getInfo())) { this.awsBinder = new AwsBinderDelegate(this.eurekaServerConfig, this.eurekaClientConfig, this.registry, this.applicationInfoManager); this.awsBinder.start(); } EurekaServerContextHolder.initialize(this.serverContext); log.info("Initialized server context"); // Copy registry from neighboring eureka node int registryCount = this.registry.syncUp(); this.registry.openForTraffic(this.applicationInfoManager, registryCount); // Register all monitoring statistics. EurekaMonitors.registerAllStats(); }
registry.openForTraffic(applicationInfoManager, registryCount);