Adjust id visibility of FizzServiceRegistration.java
This commit is contained in:
@@ -32,7 +32,7 @@ public abstract class FizzServiceRegistration {
|
|||||||
|
|
||||||
protected static final Logger log = LoggerFactory.getLogger(FizzServiceRegistration.class);
|
protected static final Logger log = LoggerFactory.getLogger(FizzServiceRegistration.class);
|
||||||
|
|
||||||
protected String id;
|
private String id;
|
||||||
|
|
||||||
private Registration registration;
|
private Registration registration;
|
||||||
|
|
||||||
@@ -44,6 +44,10 @@ public abstract class FizzServiceRegistration {
|
|||||||
this.serviceRegistry = serviceRegistry;
|
this.serviceRegistry = serviceRegistry;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
public void register() {
|
public void register() {
|
||||||
serviceRegistry.register(registration);
|
serviceRegistry.register(registration);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ public class FizzEurekaServiceRegistration extends FizzServiceRegistration {
|
|||||||
public InstanceInfo getInstanceInfo(String service) {
|
public InstanceInfo getInstanceInfo(String service) {
|
||||||
List<InstanceInfo> insts = client.getInstancesByVipAddress(service, false);
|
List<InstanceInfo> insts = client.getInstancesByVipAddress(service, false);
|
||||||
if (CollectionUtils.isEmpty(insts)) {
|
if (CollectionUtils.isEmpty(insts)) {
|
||||||
throw Utils.runtimeExceptionWithoutStack(id + " eureka no " + service);
|
throw Utils.runtimeExceptionWithoutStack(getId() + " eureka no " + service);
|
||||||
}
|
}
|
||||||
Applications apps = client.getApplications();
|
Applications apps = client.getApplications();
|
||||||
int index = (int) (apps.getNextIndex(service.toUpperCase(), false).incrementAndGet() % insts.size());
|
int index = (int) (apps.getNextIndex(service.toUpperCase(), false).incrementAndGet() % insts.size());
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ public class FizzNacosServiceRegistration extends FizzServiceRegistration {
|
|||||||
return RegistryCenter.Status.DOWN;
|
return RegistryCenter.Status.DOWN;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
log.warn("{} status is {}", id, status);
|
log.warn("{} status is {}", getId(), status);
|
||||||
return RegistryCenter.Status.UNKNOWN;
|
return RegistryCenter.Status.UNKNOWN;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -119,7 +119,7 @@ public class FizzNacosServiceRegistration extends FizzServiceRegistration {
|
|||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
if (instance == null) {
|
if (instance == null) {
|
||||||
throw Utils.runtimeExceptionWithoutStack(id + " nacos no " + service);
|
throw Utils.runtimeExceptionWithoutStack(getId() + " nacos no " + service);
|
||||||
}
|
}
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user