refactor: modify variable naming and extract constants (#13176)

This commit is contained in:
lazy 2023-10-10 00:59:28 -05:00 committed by GitHub
parent bbee466e44
commit c72c55aa67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 3 deletions

View File

@ -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";
}

View File

@ -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);
}

View File

@ -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;
}