refactor: modify variable naming and extract constants (#13176)
This commit is contained in:
parent
bbee466e44
commit
c72c55aa67
|
|
@ -142,5 +142,6 @@ public interface RegistryConstants {
|
|||
String ENABLE_EMPTY_PROTECTION_KEY = "enable-empty-protection";
|
||||
boolean DEFAULT_ENABLE_EMPTY_PROTECTION = false;
|
||||
String REGISTER_CONSUMER_URL_KEY = "register-consumer-url";
|
||||
String REGISTRY_PROTOCOL_TYPE = "registry-protocol-type";
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -226,7 +226,7 @@ public class ServiceConfig<T> extends ServiceConfigBase<T> {
|
|||
exporters.clear();
|
||||
}
|
||||
unexported = true;
|
||||
onUnexpoted();
|
||||
onUnExported();
|
||||
ModuleServiceRepository repository = getScopeModel().getServiceRepository();
|
||||
repository.unregisterProvider(providerModel);
|
||||
}
|
||||
|
|
@ -918,7 +918,7 @@ public class ServiceConfig<T> extends ServiceConfigBase<T> {
|
|||
}
|
||||
}
|
||||
|
||||
protected void onUnexpoted() {
|
||||
protected void onUnExported() {
|
||||
for (ServiceListener serviceListener : this.serviceListeners) {
|
||||
serviceListener.unexported(this);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -111,6 +111,7 @@ import static org.apache.dubbo.common.constants.RegistryConstants.REGISTRY_KEY;
|
|||
import static org.apache.dubbo.common.constants.RegistryConstants.REGISTRY_PROTOCOL;
|
||||
import static org.apache.dubbo.common.constants.RegistryConstants.REGISTRY_TYPE_KEY;
|
||||
import static org.apache.dubbo.common.constants.RegistryConstants.SERVICE_REGISTRY_PROTOCOL;
|
||||
import static org.apache.dubbo.common.constants.RegistryConstants.REGISTRY_PROTOCOL_TYPE;
|
||||
import static org.apache.dubbo.common.constants.RemotingConstants.BACKUP_KEY;
|
||||
import static org.apache.dubbo.common.utils.StringUtils.isEmpty;
|
||||
import static org.apache.dubbo.common.utils.StringUtils.isNotEmpty;
|
||||
|
|
@ -605,7 +606,7 @@ public class ConfigValidationUtils {
|
|||
}
|
||||
|
||||
private static String getRegistryProtocolType(URL url) {
|
||||
String registryProtocol = url.getParameter("registry-protocol-type");
|
||||
String registryProtocol = url.getParameter(REGISTRY_PROTOCOL_TYPE);
|
||||
return isNotEmpty(registryProtocol) ? registryProtocol : REGISTRY_PROTOCOL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue