This is an automated email from the ASF dual-hosted git repository.

albumenj pushed a commit to branch 3.2
in repository https://gitbox.apache.org/repos/asf/dubbo.git


The following commit(s) were added to refs/heads/3.2 by this push:
     new d6661cf501 Introduce DelegateURL to proxy apache URL to alibaba URL 
(#12449)
d6661cf501 is described below

commit d6661cf5018078738910a705a5d9bfbd5dcac541
Author: Albumen Kevin <[email protected]>
AuthorDate: Mon Jun 5 10:09:30 2023 +0800

    Introduce DelegateURL to proxy apache URL to alibaba URL (#12449)
    
    * Introduce DelegateURL to proxy apache URL to alibaba URL
    
    * Fix license
---
 .../java/com/alibaba/dubbo/cache/CacheFactory.java |    3 +-
 .../dubbo/cache/support/AbstractCacheFactory.java  |    3 +-
 .../java/com/alibaba/dubbo/common/DelegateURL.java | 1054 ++++++++++++++++++++
 .../main/java/com/alibaba/dubbo/common/URL.java    |    2 +-
 .../dubbo/common/serialize/Serialization.java      |    5 +-
 .../dubbo/common/threadpool/ThreadPool.java        |    2 +-
 .../com/alibaba/dubbo/common/utils/UrlUtils.java   |    7 +-
 .../java/com/alibaba/dubbo/monitor/Monitor.java    |    4 +-
 .../com/alibaba/dubbo/monitor/MonitorFactory.java  |    2 +-
 .../com/alibaba/dubbo/registry/NotifyListener.java |    3 +-
 .../java/com/alibaba/dubbo/registry/Registry.java  |   10 +-
 .../alibaba/dubbo/registry/RegistryFactory.java    |    2 +-
 .../dubbo/registry/support/AbstractRegistry.java   |   22 +-
 .../registry/support/AbstractRegistryFactory.java  |    2 +-
 .../dubbo/registry/support/FailbackRegistry.java   |   21 +-
 .../com/alibaba/dubbo/remoting/Transporter.java    |    3 +-
 .../main/java/com/alibaba/dubbo/rpc/Invoker.java   |    3 +-
 .../main/java/com/alibaba/dubbo/rpc/Protocol.java  |    3 +-
 .../java/com/alibaba/dubbo/rpc/ProxyFactory.java   |    2 +-
 .../java/com/alibaba/dubbo/rpc/RpcContext.java     |    5 +-
 .../alibaba/dubbo/rpc/cluster/Configurator.java    |    2 +-
 .../dubbo/rpc/cluster/ConfiguratorFactory.java     |    2 +-
 .../com/alibaba/dubbo/rpc/cluster/LoadBalance.java |    8 +-
 .../java/com/alibaba/dubbo/rpc/cluster/Router.java |    5 +-
 .../alibaba/dubbo/rpc/cluster/RouterFactory.java   |    2 +-
 .../alibaba/dubbo/rpc/cluster/RuleConverter.java   |    2 +-
 26 files changed, 1124 insertions(+), 55 deletions(-)

diff --git 
a/dubbo-compatible/src/main/java/com/alibaba/dubbo/cache/CacheFactory.java 
b/dubbo-compatible/src/main/java/com/alibaba/dubbo/cache/CacheFactory.java
index d72661d2df..626eed2b4e 100644
--- a/dubbo-compatible/src/main/java/com/alibaba/dubbo/cache/CacheFactory.java
+++ b/dubbo-compatible/src/main/java/com/alibaba/dubbo/cache/CacheFactory.java
@@ -17,6 +17,7 @@
 
 package com.alibaba.dubbo.cache;
 
+import com.alibaba.dubbo.common.DelegateURL;
 import com.alibaba.dubbo.common.URL;
 import com.alibaba.dubbo.rpc.Invocation;
 
@@ -26,6 +27,6 @@ public interface CacheFactory extends 
org.apache.dubbo.cache.CacheFactory {
     Cache getCache(URL url, Invocation invocation);
 
     default org.apache.dubbo.cache.Cache getCache(org.apache.dubbo.common.URL 
url, org.apache.dubbo.rpc.Invocation invocation) {
-        return this.getCache(new URL(url), new 
Invocation.CompatibleInvocation(invocation));
+        return this.getCache(new DelegateURL(url), new 
Invocation.CompatibleInvocation(invocation));
     }
 }
diff --git 
a/dubbo-compatible/src/main/java/com/alibaba/dubbo/cache/support/AbstractCacheFactory.java
 
b/dubbo-compatible/src/main/java/com/alibaba/dubbo/cache/support/AbstractCacheFactory.java
index e7a05fdebb..6ca184c660 100644
--- 
a/dubbo-compatible/src/main/java/com/alibaba/dubbo/cache/support/AbstractCacheFactory.java
+++ 
b/dubbo-compatible/src/main/java/com/alibaba/dubbo/cache/support/AbstractCacheFactory.java
@@ -19,6 +19,7 @@ package com.alibaba.dubbo.cache.support;
 
 import com.alibaba.dubbo.cache.Cache;
 import com.alibaba.dubbo.cache.CacheFactory;
+import com.alibaba.dubbo.common.DelegateURL;
 import com.alibaba.dubbo.common.URL;
 import com.alibaba.dubbo.rpc.Invocation;
 
@@ -48,6 +49,6 @@ public abstract class AbstractCacheFactory implements 
CacheFactory {
 
     @Override
     public org.apache.dubbo.cache.Cache getCache(org.apache.dubbo.common.URL 
url, org.apache.dubbo.rpc.Invocation invocation) {
-        return getCache(new URL(url), new 
Invocation.CompatibleInvocation(invocation));
+        return getCache(new DelegateURL(url), new 
Invocation.CompatibleInvocation(invocation));
     }
 }
diff --git 
a/dubbo-compatible/src/main/java/com/alibaba/dubbo/common/DelegateURL.java 
b/dubbo-compatible/src/main/java/com/alibaba/dubbo/common/DelegateURL.java
new file mode 100644
index 0000000000..2825e89cea
--- /dev/null
+++ b/dubbo-compatible/src/main/java/com/alibaba/dubbo/common/DelegateURL.java
@@ -0,0 +1,1054 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.alibaba.dubbo.common;
+
+import org.apache.dubbo.common.config.Configuration;
+import org.apache.dubbo.common.url.component.URLAddress;
+import org.apache.dubbo.common.url.component.URLParam;
+import org.apache.dubbo.rpc.model.ApplicationModel;
+import org.apache.dubbo.rpc.model.FrameworkModel;
+import org.apache.dubbo.rpc.model.ModuleModel;
+import org.apache.dubbo.rpc.model.ScopeModel;
+import org.apache.dubbo.rpc.model.ServiceModel;
+
+import java.net.InetSocketAddress;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.function.Predicate;
+
+@Deprecated
+public class DelegateURL extends com.alibaba.dubbo.common.URL {
+    protected final org.apache.dubbo.common.URL apacheUrl;
+
+    public DelegateURL(org.apache.dubbo.common.URL apacheUrl) {
+        this.apacheUrl = apacheUrl;
+    }
+
+    public static com.alibaba.dubbo.common.URL valueOf(String url) {
+        return new DelegateURL(org.apache.dubbo.common.URL.valueOf(url));
+    }
+
+    @Override
+    public String getProtocol() {
+        return apacheUrl.getProtocol();
+    }
+
+    @Override
+    public com.alibaba.dubbo.common.URL setProtocol(String protocol) {
+        return new DelegateURL(apacheUrl.setProtocol(protocol));
+    }
+
+    @Override
+    public String getUsername() {
+        return apacheUrl.getUsername();
+    }
+
+    @Override
+    public com.alibaba.dubbo.common.URL setUsername(String username) {
+        return new DelegateURL(apacheUrl.setUsername(username));
+    }
+
+    @Override
+    public String getPassword() {
+        return apacheUrl.getPassword();
+    }
+
+    @Override
+    public com.alibaba.dubbo.common.URL setPassword(String password) {
+        return new DelegateURL(apacheUrl.setPassword(password));
+    }
+
+    @Override
+    public String getAuthority() {
+        return apacheUrl.getAuthority();
+    }
+
+    @Override
+    public String getHost() {
+        return apacheUrl.getHost();
+    }
+
+    @Override
+    public com.alibaba.dubbo.common.URL setHost(String host) {
+        return new DelegateURL(apacheUrl.setHost(host));
+    }
+
+    @Override
+    public String getIp() {
+        return apacheUrl.getIp();
+    }
+
+    @Override
+    public int getPort() {
+        return apacheUrl.getPort();
+    }
+
+    @Override
+    public com.alibaba.dubbo.common.URL setPort(int port) {
+        return new DelegateURL(apacheUrl.setPort(port));
+    }
+
+    @Override
+    public int getPort(int defaultPort) {
+        return apacheUrl.getPort(defaultPort);
+    }
+
+    @Override
+    public String getAddress() {
+        return apacheUrl.getAddress();
+    }
+
+    @Override
+    public com.alibaba.dubbo.common.URL setAddress(String address) {
+        return new DelegateURL(apacheUrl.setAddress(address));
+    }
+
+    @Override
+    public String getBackupAddress() {
+        return apacheUrl.getBackupAddress();
+    }
+
+    @Override
+    public String getBackupAddress(int defaultPort) {
+        return apacheUrl.getBackupAddress(defaultPort);
+    }
+
+    @Override
+    public String getPath() {
+        return apacheUrl.getPath();
+    }
+
+    @Override
+    public com.alibaba.dubbo.common.URL setPath(String path) {
+        return new DelegateURL(apacheUrl.setPath(path));
+    }
+
+    @Override
+    public String getAbsolutePath() {
+        return apacheUrl.getAbsolutePath();
+    }
+
+    @Override
+    public Map<String, String> getParameters() {
+        return apacheUrl.getParameters();
+    }
+
+    @Override
+    public String getParameterAndDecoded(String key) {
+        return apacheUrl.getParameterAndDecoded(key);
+    }
+
+    @Override
+    public String getParameterAndDecoded(String key, String defaultValue) {
+        return apacheUrl.getParameterAndDecoded(key, defaultValue);
+    }
+
+    @Override
+    public String getParameter(String key) {
+        return apacheUrl.getParameter(key);
+    }
+
+    @Override
+    public String getParameter(String key, String defaultValue) {
+        return apacheUrl.getParameter(key, defaultValue);
+    }
+
+    @Override
+    public String[] getParameter(String key, String[] defaultValue) {
+        return apacheUrl.getParameter(key, defaultValue);
+    }
+
+    @Override
+    public com.alibaba.dubbo.common.URL getUrlParameter(String key) {
+        return new DelegateURL(apacheUrl.getUrlParameter(key));
+    }
+
+    @Override
+    public double getParameter(String key, double defaultValue) {
+        return apacheUrl.getParameter(key, defaultValue);
+    }
+
+    @Override
+    public float getParameter(String key, float defaultValue) {
+        return apacheUrl.getParameter(key, defaultValue);
+    }
+
+    @Override
+    public long getParameter(String key, long defaultValue) {
+        return apacheUrl.getParameter(key, defaultValue);
+    }
+
+    @Override
+    public int getParameter(String key, int defaultValue) {
+        return apacheUrl.getParameter(key, defaultValue);
+    }
+
+    @Override
+    public short getParameter(String key, short defaultValue) {
+        return apacheUrl.getParameter(key, defaultValue);
+    }
+
+    @Override
+    public byte getParameter(String key, byte defaultValue) {
+        return apacheUrl.getParameter(key, defaultValue);
+    }
+
+    @Override
+    public float getPositiveParameter(String key, float defaultValue) {
+        return apacheUrl.getPositiveParameter(key, defaultValue);
+    }
+
+    @Override
+    public double getPositiveParameter(String key, double defaultValue) {
+        return apacheUrl.getPositiveParameter(key, defaultValue);
+    }
+
+    @Override
+    public long getPositiveParameter(String key, long defaultValue) {
+        return apacheUrl.getPositiveParameter(key, defaultValue);
+    }
+
+    @Override
+    public int getPositiveParameter(String key, int defaultValue) {
+        return apacheUrl.getPositiveParameter(key, defaultValue);
+    }
+
+    @Override
+    public short getPositiveParameter(String key, short defaultValue) {
+        return apacheUrl.getPositiveParameter(key, defaultValue);
+    }
+
+    @Override
+    public byte getPositiveParameter(String key, byte defaultValue) {
+        return apacheUrl.getPositiveParameter(key, defaultValue);
+    }
+
+    @Override
+    public char getParameter(String key, char defaultValue) {
+        return apacheUrl.getParameter(key, defaultValue);
+    }
+
+    @Override
+    public boolean getParameter(String key, boolean defaultValue) {
+        return apacheUrl.getParameter(key, defaultValue);
+    }
+
+    @Override
+    public boolean hasParameter(String key) {
+        return apacheUrl.hasParameter(key);
+    }
+
+    @Override
+    public String getMethodParameterAndDecoded(String method, String key) {
+        return apacheUrl.getMethodParameterAndDecoded(method, key);
+    }
+
+    @Override
+    public String getMethodParameterAndDecoded(String method, String key, 
String defaultValue) {
+        return apacheUrl.getMethodParameterAndDecoded(method, key, 
defaultValue);
+    }
+
+    @Override
+    public String getMethodParameter(String method, String key) {
+        return apacheUrl.getMethodParameter(method, key);
+    }
+
+    @Override
+    public String getMethodParameter(String method, String key, String 
defaultValue) {
+        return apacheUrl.getMethodParameter(method, key, defaultValue);
+    }
+
+    @Override
+    public double getMethodParameter(String method, String key, double 
defaultValue) {
+        return apacheUrl.getMethodParameter(method, key, defaultValue);
+    }
+
+    @Override
+    public float getMethodParameter(String method, String key, float 
defaultValue) {
+        return apacheUrl.getMethodParameter(method, key, defaultValue);
+    }
+
+    @Override
+    public long getMethodParameter(String method, String key, long 
defaultValue) {
+        return apacheUrl.getMethodParameter(method, key, defaultValue);
+    }
+
+    @Override
+    public int getMethodParameter(String method, String key, int defaultValue) 
{
+        return apacheUrl.getMethodParameter(method, key, defaultValue);
+    }
+
+    @Override
+    public short getMethodParameter(String method, String key, short 
defaultValue) {
+        return apacheUrl.getMethodParameter(method, key, defaultValue);
+    }
+
+    @Override
+    public byte getMethodParameter(String method, String key, byte 
defaultValue) {
+        return apacheUrl.getMethodParameter(method, key, defaultValue);
+    }
+
+    @Override
+    public double getMethodPositiveParameter(String method, String key, double 
defaultValue) {
+        return apacheUrl.getMethodPositiveParameter(method, key, defaultValue);
+    }
+
+    @Override
+    public float getMethodPositiveParameter(String method, String key, float 
defaultValue) {
+        return apacheUrl.getMethodPositiveParameter(method, key, defaultValue);
+    }
+
+    @Override
+    public long getMethodPositiveParameter(String method, String key, long 
defaultValue) {
+        return apacheUrl.getMethodPositiveParameter(method, key, defaultValue);
+    }
+
+    @Override
+    public int getMethodPositiveParameter(String method, String key, int 
defaultValue) {
+        return apacheUrl.getMethodPositiveParameter(method, key, defaultValue);
+    }
+
+    @Override
+    public short getMethodPositiveParameter(String method, String key, short 
defaultValue) {
+        return apacheUrl.getMethodPositiveParameter(method, key, defaultValue);
+    }
+
+    @Override
+    public byte getMethodPositiveParameter(String method, String key, byte 
defaultValue) {
+        return apacheUrl.getMethodPositiveParameter(method, key, defaultValue);
+    }
+
+    @Override
+    public char getMethodParameter(String method, String key, char 
defaultValue) {
+        return apacheUrl.getMethodParameter(method, key, defaultValue);
+    }
+
+    @Override
+    public boolean getMethodParameter(String method, String key, boolean 
defaultValue) {
+        return apacheUrl.getMethodParameter(method, key, defaultValue);
+    }
+
+    @Override
+    public boolean hasMethodParameter(String method, String key) {
+        return apacheUrl.hasMethodParameter(method, key);
+    }
+
+    @Override
+    public boolean isLocalHost() {
+        return apacheUrl.isLocalHost();
+    }
+
+    @Override
+    public boolean isAnyHost() {
+        return apacheUrl.isAnyHost();
+    }
+
+    @Override
+    public com.alibaba.dubbo.common.URL addParameterAndEncoded(String key, 
String value) {
+        return new DelegateURL(apacheUrl.addParameterAndEncoded(key, value));
+    }
+
+    @Override
+    public com.alibaba.dubbo.common.URL addParameter(String key, boolean 
value) {
+        return new DelegateURL(apacheUrl.addParameter(key, value));
+    }
+
+    @Override
+    public com.alibaba.dubbo.common.URL addParameter(String key, char value) {
+        return new DelegateURL(apacheUrl.addParameter(key, value));
+    }
+
+    @Override
+    public com.alibaba.dubbo.common.URL addParameter(String key, byte value) {
+        return new DelegateURL(apacheUrl.addParameter(key, value));
+    }
+
+    @Override
+    public com.alibaba.dubbo.common.URL addParameter(String key, short value) {
+        return new DelegateURL(apacheUrl.addParameter(key, value));
+    }
+
+    @Override
+    public com.alibaba.dubbo.common.URL addParameter(String key, int value) {
+        return new DelegateURL(apacheUrl.addParameter(key, value));
+    }
+
+    @Override
+    public com.alibaba.dubbo.common.URL addParameter(String key, long value) {
+        return new DelegateURL(apacheUrl.addParameter(key, value));
+    }
+
+    @Override
+    public com.alibaba.dubbo.common.URL addParameter(String key, float value) {
+        return new DelegateURL(apacheUrl.addParameter(key, value));
+    }
+
+    @Override
+    public com.alibaba.dubbo.common.URL addParameter(String key, double value) 
{
+        return new DelegateURL(apacheUrl.addParameter(key, value));
+    }
+
+    @Override
+    public com.alibaba.dubbo.common.URL addParameter(String key, Enum<?> 
value) {
+        return new DelegateURL(apacheUrl.addParameter(key, value));
+    }
+
+    @Override
+    public com.alibaba.dubbo.common.URL addParameter(String key, Number value) 
{
+        return new DelegateURL(apacheUrl.addParameter(key, value));
+    }
+
+    @Override
+    public com.alibaba.dubbo.common.URL addParameter(String key, CharSequence 
value) {
+        return new DelegateURL(apacheUrl.addParameter(key, value));
+    }
+
+    @Override
+    public com.alibaba.dubbo.common.URL addParameter(String key, String value) 
{
+        return new DelegateURL(apacheUrl.addParameter(key, value));
+    }
+
+    @Override
+    public com.alibaba.dubbo.common.URL addParameterIfAbsent(String key, 
String value) {
+        return new DelegateURL(apacheUrl.addParameterIfAbsent(key, value));
+    }
+
+    @Override
+    public com.alibaba.dubbo.common.URL addParameters(Map<String, String> 
parameters) {
+        return new DelegateURL(apacheUrl.addParameters(parameters));
+    }
+
+    @Override
+    public com.alibaba.dubbo.common.URL addParametersIfAbsent(Map<String, 
String> parameters) {
+        return new DelegateURL(apacheUrl.addParametersIfAbsent(parameters));
+    }
+
+    @Override
+    public com.alibaba.dubbo.common.URL addParameters(String... pairs) {
+        return new DelegateURL(apacheUrl.addParameters(pairs));
+    }
+
+    @Override
+    public com.alibaba.dubbo.common.URL addParameterString(String query) {
+        return new DelegateURL(apacheUrl.addParameterString(query));
+    }
+
+    @Override
+    public com.alibaba.dubbo.common.URL removeParameter(String key) {
+        return new DelegateURL(apacheUrl.removeParameter(key));
+    }
+
+    @Override
+    public com.alibaba.dubbo.common.URL removeParameters(Collection<String> 
keys) {
+        return new DelegateURL(apacheUrl.removeParameters(keys));
+    }
+
+    @Override
+    public com.alibaba.dubbo.common.URL removeParameters(String... keys) {
+        return new DelegateURL(apacheUrl.removeParameters(keys));
+    }
+
+    @Override
+    public com.alibaba.dubbo.common.URL clearParameters() {
+        return new DelegateURL(apacheUrl.clearParameters());
+    }
+
+    @Override
+    public String getRawParameter(String key) {
+        return apacheUrl.getRawParameter(key);
+    }
+
+    @Override
+    public Map<String, String> toMap() {
+        return apacheUrl.toMap();
+    }
+
+    @Override
+    public String toString() {
+        return apacheUrl.toString();
+    }
+
+    @Override
+    public String toString(String... parameters) {
+        return apacheUrl.toString(parameters);
+    }
+
+    @Override
+    public String toIdentityString() {
+        return apacheUrl.toIdentityString();
+    }
+
+    @Override
+    public String toIdentityString(String... parameters) {
+        return apacheUrl.toIdentityString(parameters);
+    }
+
+    @Override
+    public String toFullString() {
+        return apacheUrl.toFullString();
+    }
+
+    @Override
+    public String toFullString(String... parameters) {
+        return apacheUrl.toFullString(parameters);
+    }
+
+    @Override
+    public String toParameterString() {
+        return apacheUrl.toParameterString();
+    }
+
+    @Override
+    public String toParameterString(String... parameters) {
+        return apacheUrl.toParameterString(parameters);
+    }
+
+    @Override
+    public java.net.URL toJavaURL() {
+        return apacheUrl.toJavaURL();
+    }
+
+    @Override
+    public InetSocketAddress toInetSocketAddress() {
+        return apacheUrl.toInetSocketAddress();
+    }
+
+    @Override
+    public String getServiceKey() {
+        return apacheUrl.getServiceKey();
+    }
+
+    @Override
+    public String toServiceStringWithoutResolving() {
+        return apacheUrl.toServiceStringWithoutResolving();
+    }
+
+    @Override
+    public String toServiceString() {
+        return apacheUrl.toServiceString();
+    }
+
+    @Override
+    public String getServiceInterface() {
+        return apacheUrl.getServiceInterface();
+    }
+
+    @Override
+    public com.alibaba.dubbo.common.URL setServiceInterface(String service) {
+        return new DelegateURL(apacheUrl.setServiceInterface(service));
+    }
+
+    @Override
+    public org.apache.dubbo.common.URL getOriginalURL() {
+        return apacheUrl;
+    }
+
+    @Override
+    public URLAddress getUrlAddress() {
+        return apacheUrl.getUrlAddress();
+    }
+
+    @Override
+    public URLParam getUrlParam() {
+        return apacheUrl.getUrlParam();
+    }
+
+    @Override
+    public String getUserInformation() {
+        return apacheUrl.getUserInformation();
+    }
+
+    @Override
+    public List<org.apache.dubbo.common.URL> getBackupUrls() {
+        return apacheUrl.getBackupUrls();
+    }
+
+    @Override
+    public Map<String, String> getOriginalParameters() {
+        return apacheUrl.getOriginalParameters();
+    }
+
+    @Override
+    public Map<String, String> getAllParameters() {
+        return apacheUrl.getAllParameters();
+    }
+
+    @Override
+    public Map<String, String> getParameters(Predicate<String> nameToSelect) {
+        return apacheUrl.getParameters(nameToSelect);
+    }
+
+    @Override
+    public String getOriginalParameter(String key) {
+        return apacheUrl.getOriginalParameter(key);
+    }
+
+    @Override
+    public List<String> getParameter(String key, List<String> defaultValue) {
+        return apacheUrl.getParameter(key, defaultValue);
+    }
+
+    @Override
+    public <T> T getParameter(String key, Class<T> valueType) {
+        return apacheUrl.getParameter(key, valueType);
+    }
+
+    @Override
+    public <T> T getParameter(String key, Class<T> valueType, T defaultValue) {
+        return apacheUrl.getParameter(key, valueType, defaultValue);
+    }
+
+    @Override
+    public org.apache.dubbo.common.URL setScopeModel(ScopeModel scopeModel) {
+        return apacheUrl.setScopeModel(scopeModel);
+    }
+
+    @Override
+    public ScopeModel getScopeModel() {
+        return apacheUrl.getScopeModel();
+    }
+
+    @Override
+    public FrameworkModel getOrDefaultFrameworkModel() {
+        return apacheUrl.getOrDefaultFrameworkModel();
+    }
+
+    @Override
+    public ApplicationModel getOrDefaultApplicationModel() {
+        return apacheUrl.getOrDefaultApplicationModel();
+    }
+
+    @Override
+    public ApplicationModel getApplicationModel() {
+        return apacheUrl.getApplicationModel();
+    }
+
+    @Override
+    public ModuleModel getOrDefaultModuleModel() {
+        return apacheUrl.getOrDefaultModuleModel();
+    }
+
+    @Override
+    public org.apache.dubbo.common.URL setServiceModel(ServiceModel 
serviceModel) {
+        return apacheUrl.setServiceModel(serviceModel);
+    }
+
+    @Override
+    public ServiceModel getServiceModel() {
+        return apacheUrl.getServiceModel();
+    }
+
+    @Override
+    public String getMethodParameterStrict(String method, String key) {
+        return apacheUrl.getMethodParameterStrict(method, key);
+    }
+
+    @Override
+    public String getAnyMethodParameter(String key) {
+        return apacheUrl.getAnyMethodParameter(key);
+    }
+
+    @Override
+    public boolean hasMethodParameter(String method) {
+        return apacheUrl.hasMethodParameter(method);
+    }
+
+    @Override
+    public Map<String, String> toOriginalMap() {
+        return apacheUrl.toOriginalMap();
+    }
+
+    @Override
+    public String getColonSeparatedKey() {
+        return apacheUrl.getColonSeparatedKey();
+    }
+
+    @Override
+    public String getDisplayServiceKey() {
+        return apacheUrl.getDisplayServiceKey();
+    }
+
+    @Override
+    public String getPathKey() {
+        return apacheUrl.getPathKey();
+    }
+
+    public static String buildKey(String path, String group, String version) {
+        return org.apache.dubbo.common.URL.buildKey(path, group, version);
+    }
+
+    @Override
+    public String getProtocolServiceKey() {
+        return apacheUrl.getProtocolServiceKey();
+    }
+
+    @Override
+    @Deprecated
+    public String getServiceName() {
+        return apacheUrl.getServiceName();
+    }
+
+    @Override
+    @Deprecated
+    public int getIntParameter(String key) {
+        return apacheUrl.getIntParameter(key);
+    }
+
+    @Override
+    @Deprecated
+    public int getIntParameter(String key, int defaultValue) {
+        return apacheUrl.getIntParameter(key, defaultValue);
+    }
+
+    @Override
+    @Deprecated
+    public int getPositiveIntParameter(String key, int defaultValue) {
+        return apacheUrl.getPositiveIntParameter(key, defaultValue);
+    }
+
+    @Override
+    @Deprecated
+    public boolean getBooleanParameter(String key) {
+        return apacheUrl.getBooleanParameter(key);
+    }
+
+    @Override
+    @Deprecated
+    public boolean getBooleanParameter(String key, boolean defaultValue) {
+        return apacheUrl.getBooleanParameter(key, defaultValue);
+    }
+
+    @Override
+    @Deprecated
+    public int getMethodIntParameter(String method, String key) {
+        return apacheUrl.getMethodIntParameter(method, key);
+    }
+
+    @Override
+    @Deprecated
+    public int getMethodIntParameter(String method, String key, int 
defaultValue) {
+        return apacheUrl.getMethodIntParameter(method, key, defaultValue);
+    }
+
+    @Override
+    @Deprecated
+    public int getMethodPositiveIntParameter(String method, String key, int 
defaultValue) {
+        return apacheUrl.getMethodPositiveIntParameter(method, key, 
defaultValue);
+    }
+
+    @Override
+    @Deprecated
+    public boolean getMethodBooleanParameter(String method, String key) {
+        return apacheUrl.getMethodBooleanParameter(method, key);
+    }
+
+    @Override
+    @Deprecated
+    public boolean getMethodBooleanParameter(String method, String key, 
boolean defaultValue) {
+        return apacheUrl.getMethodBooleanParameter(method, key, defaultValue);
+    }
+
+    @Override
+    public Configuration toConfiguration() {
+        return apacheUrl.toConfiguration();
+    }
+
+    @Override
+    public int hashCode() {
+        return apacheUrl.hashCode();
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        return apacheUrl.equals(obj);
+    }
+
+    public static void putMethodParameter(String method, String key, String 
value, Map<String, Map<String, String>> methodParameters) {
+        org.apache.dubbo.common.URL.putMethodParameter(method, key, value, 
methodParameters);
+    }
+
+    @Override
+    public String getApplication(String defaultValue) {
+        return apacheUrl.getApplication(defaultValue);
+    }
+
+    @Override
+    public String getApplication() {
+        return apacheUrl.getApplication();
+    }
+
+    @Override
+    public String getRemoteApplication() {
+        return apacheUrl.getRemoteApplication();
+    }
+
+    @Override
+    public String getGroup() {
+        return apacheUrl.getGroup();
+    }
+
+    @Override
+    public String getGroup(String defaultValue) {
+        return apacheUrl.getGroup(defaultValue);
+    }
+
+    @Override
+    public String getVersion() {
+        return apacheUrl.getVersion();
+    }
+
+    @Override
+    public String getVersion(String defaultValue) {
+        return apacheUrl.getVersion(defaultValue);
+    }
+
+    @Override
+    public String getConcatenatedParameter(String key) {
+        return apacheUrl.getConcatenatedParameter(key);
+    }
+
+    @Override
+    public String getCategory(String defaultValue) {
+        return apacheUrl.getCategory(defaultValue);
+    }
+
+    @Override
+    public String[] getCategory(String[] defaultValue) {
+        return apacheUrl.getCategory(defaultValue);
+    }
+
+    @Override
+    public String getCategory() {
+        return apacheUrl.getCategory();
+    }
+
+    @Override
+    public String getSide(String defaultValue) {
+        return apacheUrl.getSide(defaultValue);
+    }
+
+    @Override
+    public String getSide() {
+        return apacheUrl.getSide();
+    }
+
+    @Override
+    public Map<String, Object> getAttributes() {
+        return apacheUrl.getAttributes();
+    }
+
+    @Override
+    public org.apache.dubbo.common.URL addAttributes(Map<String, Object> 
attributes) {
+        return apacheUrl.addAttributes(attributes);
+    }
+
+    @Override
+    public Object getAttribute(String key) {
+        return apacheUrl.getAttribute(key);
+    }
+
+    @Override
+    public Object getAttribute(String key, Object defaultValue) {
+        return apacheUrl.getAttribute(key, defaultValue);
+    }
+
+    @Override
+    public org.apache.dubbo.common.URL putAttribute(String key, Object obj) {
+        return apacheUrl.putAttribute(key, obj);
+    }
+
+    @Override
+    public org.apache.dubbo.common.URL removeAttribute(String key) {
+        return apacheUrl.removeAttribute(key);
+    }
+
+    @Override
+    public boolean hasAttribute(String key) {
+        return apacheUrl.hasAttribute(key);
+    }
+
+    @Override
+    public Map<String, String> getOriginalServiceParameters(String service) {
+        return apacheUrl.getOriginalServiceParameters(service);
+    }
+
+    @Override
+    public Map<String, String> getServiceParameters(String service) {
+        return apacheUrl.getServiceParameters(service);
+    }
+
+    @Override
+    public String getOriginalServiceParameter(String service, String key) {
+        return apacheUrl.getOriginalServiceParameter(service, key);
+    }
+
+    @Override
+    public String getServiceParameter(String service, String key) {
+        return apacheUrl.getServiceParameter(service, key);
+    }
+
+    @Override
+    public String getServiceParameter(String service, String key, String 
defaultValue) {
+        return apacheUrl.getServiceParameter(service, key, defaultValue);
+    }
+
+    @Override
+    public int getServiceParameter(String service, String key, int 
defaultValue) {
+        return apacheUrl.getServiceParameter(service, key, defaultValue);
+    }
+
+    @Override
+    public double getServiceParameter(String service, String key, double 
defaultValue) {
+        return apacheUrl.getServiceParameter(service, key, defaultValue);
+    }
+
+    @Override
+    public float getServiceParameter(String service, String key, float 
defaultValue) {
+        return apacheUrl.getServiceParameter(service, key, defaultValue);
+    }
+
+    @Override
+    public long getServiceParameter(String service, String key, long 
defaultValue) {
+        return apacheUrl.getServiceParameter(service, key, defaultValue);
+    }
+
+    @Override
+    public short getServiceParameter(String service, String key, short 
defaultValue) {
+        return apacheUrl.getServiceParameter(service, key, defaultValue);
+    }
+
+    @Override
+    public byte getServiceParameter(String service, String key, byte 
defaultValue) {
+        return apacheUrl.getServiceParameter(service, key, defaultValue);
+    }
+
+    @Override
+    public char getServiceParameter(String service, String key, char 
defaultValue) {
+        return apacheUrl.getServiceParameter(service, key, defaultValue);
+    }
+
+    @Override
+    public boolean getServiceParameter(String service, String key, boolean 
defaultValue) {
+        return apacheUrl.getServiceParameter(service, key, defaultValue);
+    }
+
+    @Override
+    public boolean hasServiceParameter(String service, String key) {
+        return apacheUrl.hasServiceParameter(service, key);
+    }
+
+    @Override
+    public float getPositiveServiceParameter(String service, String key, float 
defaultValue) {
+        return apacheUrl.getPositiveServiceParameter(service, key, 
defaultValue);
+    }
+
+    @Override
+    public double getPositiveServiceParameter(String service, String key, 
double defaultValue) {
+        return apacheUrl.getPositiveServiceParameter(service, key, 
defaultValue);
+    }
+
+    @Override
+    public long getPositiveServiceParameter(String service, String key, long 
defaultValue) {
+        return apacheUrl.getPositiveServiceParameter(service, key, 
defaultValue);
+    }
+
+    @Override
+    public int getPositiveServiceParameter(String service, String key, int 
defaultValue) {
+        return apacheUrl.getPositiveServiceParameter(service, key, 
defaultValue);
+    }
+
+    @Override
+    public short getPositiveServiceParameter(String service, String key, short 
defaultValue) {
+        return apacheUrl.getPositiveServiceParameter(service, key, 
defaultValue);
+    }
+
+    @Override
+    public byte getPositiveServiceParameter(String service, String key, byte 
defaultValue) {
+        return apacheUrl.getPositiveServiceParameter(service, key, 
defaultValue);
+    }
+
+    @Override
+    public String getServiceMethodParameterAndDecoded(String service, String 
method, String key) {
+        return apacheUrl.getServiceMethodParameterAndDecoded(service, method, 
key);
+    }
+
+    @Override
+    public String getServiceMethodParameterAndDecoded(String service, String 
method, String key, String defaultValue) {
+        return apacheUrl.getServiceMethodParameterAndDecoded(service, method, 
key, defaultValue);
+    }
+
+    @Override
+    public String getServiceMethodParameterStrict(String service, String 
method, String key) {
+        return apacheUrl.getServiceMethodParameterStrict(service, method, key);
+    }
+
+    @Override
+    public String getServiceMethodParameter(String service, String method, 
String key) {
+        return apacheUrl.getServiceMethodParameter(service, method, key);
+    }
+
+    @Override
+    public String getServiceMethodParameter(String service, String method, 
String key, String defaultValue) {
+        return apacheUrl.getServiceMethodParameter(service, method, key, 
defaultValue);
+    }
+
+    @Override
+    public double getServiceMethodParameter(String service, String method, 
String key, double defaultValue) {
+        return apacheUrl.getServiceMethodParameter(service, method, key, 
defaultValue);
+    }
+
+    @Override
+    public float getServiceMethodParameter(String service, String method, 
String key, float defaultValue) {
+        return apacheUrl.getServiceMethodParameter(service, method, key, 
defaultValue);
+    }
+
+    @Override
+    public long getServiceMethodParameter(String service, String method, 
String key, long defaultValue) {
+        return apacheUrl.getServiceMethodParameter(service, method, key, 
defaultValue);
+    }
+
+    @Override
+    public int getServiceMethodParameter(String service, String method, String 
key, int defaultValue) {
+        return apacheUrl.getServiceMethodParameter(service, method, key, 
defaultValue);
+    }
+
+    @Override
+    public short getServiceMethodParameter(String service, String method, 
String key, short defaultValue) {
+        return apacheUrl.getServiceMethodParameter(service, method, key, 
defaultValue);
+    }
+
+    @Override
+    public byte getServiceMethodParameter(String service, String method, 
String key, byte defaultValue) {
+        return apacheUrl.getServiceMethodParameter(service, method, key, 
defaultValue);
+    }
+
+    @Override
+    public boolean hasServiceMethodParameter(String service, String method, 
String key) {
+        return apacheUrl.hasServiceMethodParameter(service, method, key);
+    }
+
+    @Override
+    public boolean hasServiceMethodParameter(String service, String method) {
+        return apacheUrl.hasServiceMethodParameter(service, method);
+    }
+
+    @Override
+    public org.apache.dubbo.common.URL toSerializableURL() {
+        return apacheUrl.toSerializableURL();
+    }
+}
diff --git a/dubbo-compatible/src/main/java/com/alibaba/dubbo/common/URL.java 
b/dubbo-compatible/src/main/java/com/alibaba/dubbo/common/URL.java
index 361cd0776d..3491c841d5 100644
--- a/dubbo-compatible/src/main/java/com/alibaba/dubbo/common/URL.java
+++ b/dubbo-compatible/src/main/java/com/alibaba/dubbo/common/URL.java
@@ -73,7 +73,7 @@ public class URL extends org.apache.dubbo.common.URL {
 
     public static URL valueOf(String url) {
         org.apache.dubbo.common.URL result = 
org.apache.dubbo.common.URL.valueOf(url);
-        return new URL(result);
+        return new DelegateURL(result);
     }
 
     public static String encode(String value) {
diff --git 
a/dubbo-compatible/src/main/java/com/alibaba/dubbo/common/serialize/Serialization.java
 
b/dubbo-compatible/src/main/java/com/alibaba/dubbo/common/serialize/Serialization.java
index f5f59989bd..dc82b3195f 100644
--- 
a/dubbo-compatible/src/main/java/com/alibaba/dubbo/common/serialize/Serialization.java
+++ 
b/dubbo-compatible/src/main/java/com/alibaba/dubbo/common/serialize/Serialization.java
@@ -17,6 +17,7 @@
 
 package com.alibaba.dubbo.common.serialize;
 
+import com.alibaba.dubbo.common.DelegateURL;
 import com.alibaba.dubbo.common.URL;
 
 import java.io.IOException;
@@ -32,11 +33,11 @@ public interface Serialization extends 
org.apache.dubbo.common.serialize.Seriali
 
     @Override
     default org.apache.dubbo.common.serialize.ObjectOutput 
serialize(org.apache.dubbo.common.URL url, OutputStream output) throws 
IOException {
-        return this.serialize(new URL(url), output);
+        return this.serialize(new DelegateURL(url), output);
     }
 
     @Override
     default org.apache.dubbo.common.serialize.ObjectInput 
deserialize(org.apache.dubbo.common.URL url, InputStream input) throws 
IOException {
-        return this.deserialize(new URL(url), input);
+        return this.deserialize(new DelegateURL(url), input);
     }
 }
diff --git 
a/dubbo-compatible/src/main/java/com/alibaba/dubbo/common/threadpool/ThreadPool.java
 
b/dubbo-compatible/src/main/java/com/alibaba/dubbo/common/threadpool/ThreadPool.java
index 45bb6f4566..da4adf80ba 100644
--- 
a/dubbo-compatible/src/main/java/com/alibaba/dubbo/common/threadpool/ThreadPool.java
+++ 
b/dubbo-compatible/src/main/java/com/alibaba/dubbo/common/threadpool/ThreadPool.java
@@ -28,6 +28,6 @@ public interface ThreadPool extends 
org.apache.dubbo.common.threadpool.ThreadPoo
 
     @Override
     default Executor getExecutor(URL url) {
-        return getExecutor(new com.alibaba.dubbo.common.URL(url));
+        return getExecutor(new com.alibaba.dubbo.common.DelegateURL(url));
     }
 }
diff --git 
a/dubbo-compatible/src/main/java/com/alibaba/dubbo/common/utils/UrlUtils.java 
b/dubbo-compatible/src/main/java/com/alibaba/dubbo/common/utils/UrlUtils.java
index 0fa26ef6e1..aec0f871b7 100644
--- 
a/dubbo-compatible/src/main/java/com/alibaba/dubbo/common/utils/UrlUtils.java
+++ 
b/dubbo-compatible/src/main/java/com/alibaba/dubbo/common/utils/UrlUtils.java
@@ -16,6 +16,7 @@
  */
 package com.alibaba.dubbo.common.utils;
 
+import com.alibaba.dubbo.common.DelegateURL;
 import com.alibaba.dubbo.common.URL;
 
 import java.util.List;
@@ -30,11 +31,11 @@ import java.util.stream.Collectors;
 public class UrlUtils {
 
     public static URL parseURL(String address, Map<String, String> defaults) {
-        return new 
URL(org.apache.dubbo.common.utils.UrlUtils.parseURL(address, defaults));
+        return new 
DelegateURL(org.apache.dubbo.common.utils.UrlUtils.parseURL(address, defaults));
     }
 
     public static List<URL> parseURLs(String address, Map<String, String> 
defaults) {
-        return org.apache.dubbo.common.utils.UrlUtils.parseURLs(address, 
defaults).stream().map(e -> new URL(e)).collect(Collectors.toList());
+        return org.apache.dubbo.common.utils.UrlUtils.parseURLs(address, 
defaults).stream().map(e -> new DelegateURL(e)).collect(Collectors.toList());
     }
 
     public static Map<String, Map<String, String>> convertRegister(Map<String, 
Map<String, String>> register) {
@@ -64,7 +65,7 @@ public class UrlUtils {
     }
 
     public static URL getEmptyUrl(String service, String category) {
-        return new 
URL(org.apache.dubbo.common.utils.UrlUtils.getEmptyUrl(service, category));
+        return new 
DelegateURL(org.apache.dubbo.common.utils.UrlUtils.getEmptyUrl(service, 
category));
     }
 
     public static boolean isMatchCategory(String category, String categories) {
diff --git 
a/dubbo-compatible/src/main/java/com/alibaba/dubbo/monitor/Monitor.java 
b/dubbo-compatible/src/main/java/com/alibaba/dubbo/monitor/Monitor.java
index 3d4abb3cd6..6e1ed3767b 100644
--- a/dubbo-compatible/src/main/java/com/alibaba/dubbo/monitor/Monitor.java
+++ b/dubbo-compatible/src/main/java/com/alibaba/dubbo/monitor/Monitor.java
@@ -34,11 +34,11 @@ public interface Monitor extends 
org.apache.dubbo.monitor.Monitor {
 
     @Override
     default void collect(URL statistics) {
-        this.collect(new com.alibaba.dubbo.common.URL(statistics));
+        this.collect(new com.alibaba.dubbo.common.DelegateURL(statistics));
     }
 
     @Override
     default List<URL> lookup(URL query) {
-        return this.lookup(new 
com.alibaba.dubbo.common.URL(query)).stream().map(url -> 
url.getOriginalURL()).collect(Collectors.toList());
+        return this.lookup(new 
com.alibaba.dubbo.common.DelegateURL(query)).stream().map(url -> 
url.getOriginalURL()).collect(Collectors.toList());
     }
 }
diff --git 
a/dubbo-compatible/src/main/java/com/alibaba/dubbo/monitor/MonitorFactory.java 
b/dubbo-compatible/src/main/java/com/alibaba/dubbo/monitor/MonitorFactory.java
index 22e1d3ac64..4f30d1f3c7 100644
--- 
a/dubbo-compatible/src/main/java/com/alibaba/dubbo/monitor/MonitorFactory.java
+++ 
b/dubbo-compatible/src/main/java/com/alibaba/dubbo/monitor/MonitorFactory.java
@@ -27,6 +27,6 @@ public interface MonitorFactory extends 
org.apache.dubbo.monitor.MonitorFactory
 
     @Override
     default Monitor getMonitor(URL url) {
-        return this.getMonitor(new com.alibaba.dubbo.common.URL(url));
+        return this.getMonitor(new com.alibaba.dubbo.common.DelegateURL(url));
     }
 }
diff --git 
a/dubbo-compatible/src/main/java/com/alibaba/dubbo/registry/NotifyListener.java 
b/dubbo-compatible/src/main/java/com/alibaba/dubbo/registry/NotifyListener.java
index 633dc1b656..ae262e1fa7 100644
--- 
a/dubbo-compatible/src/main/java/com/alibaba/dubbo/registry/NotifyListener.java
+++ 
b/dubbo-compatible/src/main/java/com/alibaba/dubbo/registry/NotifyListener.java
@@ -17,6 +17,7 @@
 
 package com.alibaba.dubbo.registry;
 
+import com.alibaba.dubbo.common.DelegateURL;
 import com.alibaba.dubbo.common.URL;
 
 import java.util.List;
@@ -54,7 +55,7 @@ public interface NotifyListener {
         @Override
         public void notify(List<org.apache.dubbo.common.URL> urls) {
             if (listener != null) {
-                listener.notify(urls.stream().map(url -> new 
URL(url)).collect(Collectors.toList()));
+                listener.notify(urls.stream().map(url -> new 
DelegateURL(url)).collect(Collectors.toList()));
             }
         }
     }
diff --git 
a/dubbo-compatible/src/main/java/com/alibaba/dubbo/registry/Registry.java 
b/dubbo-compatible/src/main/java/com/alibaba/dubbo/registry/Registry.java
index cc9ceb14ee..8256b368db 100644
--- a/dubbo-compatible/src/main/java/com/alibaba/dubbo/registry/Registry.java
+++ b/dubbo-compatible/src/main/java/com/alibaba/dubbo/registry/Registry.java
@@ -41,29 +41,29 @@ public interface Registry extends 
org.apache.dubbo.registry.Registry {
 
     @Override
     default void register(URL url) {
-        this.register(new com.alibaba.dubbo.common.URL(url));
+        this.register(new com.alibaba.dubbo.common.DelegateURL(url));
     }
 
     @Override
     default void unregister(URL url) {
-        this.unregister(new com.alibaba.dubbo.common.URL(url));
+        this.unregister(new com.alibaba.dubbo.common.DelegateURL(url));
     }
 
     @Override
     default void subscribe(URL url, NotifyListener listener) {
-        this.subscribe(new com.alibaba.dubbo.common.URL(url),
+        this.subscribe(new com.alibaba.dubbo.common.DelegateURL(url),
                 new 
com.alibaba.dubbo.registry.NotifyListener.CompatibleNotifyListener(listener));
     }
 
     @Override
     default void unsubscribe(URL url, NotifyListener listener) {
-        this.unsubscribe(new com.alibaba.dubbo.common.URL(url),
+        this.unsubscribe(new com.alibaba.dubbo.common.DelegateURL(url),
                 new 
com.alibaba.dubbo.registry.NotifyListener.CompatibleNotifyListener(listener));
     }
 
     @Override
     default List<URL> lookup(URL url) {
-        return this.lookup(new 
com.alibaba.dubbo.common.URL(url)).stream().map(u -> u.getOriginalURL()).
+        return this.lookup(new 
com.alibaba.dubbo.common.DelegateURL(url)).stream().map(u -> 
u.getOriginalURL()).
                 collect(Collectors.toList());
     }
 }
diff --git 
a/dubbo-compatible/src/main/java/com/alibaba/dubbo/registry/RegistryFactory.java
 
b/dubbo-compatible/src/main/java/com/alibaba/dubbo/registry/RegistryFactory.java
index 5c9361213b..e0eaf5c52b 100644
--- 
a/dubbo-compatible/src/main/java/com/alibaba/dubbo/registry/RegistryFactory.java
+++ 
b/dubbo-compatible/src/main/java/com/alibaba/dubbo/registry/RegistryFactory.java
@@ -27,6 +27,6 @@ public interface RegistryFactory extends 
org.apache.dubbo.registry.RegistryFacto
 
     @Override
     default Registry getRegistry(URL url) {
-        return this.getRegistry(new com.alibaba.dubbo.common.URL(url));
+        return this.getRegistry(new com.alibaba.dubbo.common.DelegateURL(url));
     }
 }
diff --git 
a/dubbo-compatible/src/main/java/com/alibaba/dubbo/registry/support/AbstractRegistry.java
 
b/dubbo-compatible/src/main/java/com/alibaba/dubbo/registry/support/AbstractRegistry.java
index 0e271ed125..48a8cafc18 100644
--- 
a/dubbo-compatible/src/main/java/com/alibaba/dubbo/registry/support/AbstractRegistry.java
+++ 
b/dubbo-compatible/src/main/java/com/alibaba/dubbo/registry/support/AbstractRegistry.java
@@ -39,7 +39,7 @@ public abstract class AbstractRegistry implements Registry {
 
     @Override
     public com.alibaba.dubbo.common.URL getUrl() {
-        return new com.alibaba.dubbo.common.URL(abstractRegistry.getUrl());
+        return new 
com.alibaba.dubbo.common.DelegateURL(abstractRegistry.getUrl());
     }
 
     protected void setUrl(com.alibaba.dubbo.common.URL url) {
@@ -47,35 +47,35 @@ public abstract class AbstractRegistry implements Registry {
     }
 
     public Set<com.alibaba.dubbo.common.URL> getRegistered() {
-        return abstractRegistry.getRegistered().stream().map(url -> new 
com.alibaba.dubbo.common.URL(url)).collect(Collectors.toSet());
+        return abstractRegistry.getRegistered().stream().map(url -> new 
com.alibaba.dubbo.common.DelegateURL(url)).collect(Collectors.toSet());
     }
 
     public Map<com.alibaba.dubbo.common.URL, 
Set<com.alibaba.dubbo.registry.NotifyListener>> getSubscribed() {
         return abstractRegistry.getSubscribed().entrySet()
                 .stream()
-                .collect(Collectors.toMap(entry -> new 
com.alibaba.dubbo.common.URL(entry.getKey()),
+                .collect(Collectors.toMap(entry -> new 
com.alibaba.dubbo.common.DelegateURL(entry.getKey()),
                         entry -> convertToNotifyListeners(entry.getValue())));
     }
 
     public Map<com.alibaba.dubbo.common.URL, Map<String, 
List<com.alibaba.dubbo.common.URL>>> getNotified() {
         return abstractRegistry.getNotified().entrySet().stream()
-                .collect(Collectors.toMap(entry -> new 
com.alibaba.dubbo.common.URL(entry.getKey()),
+                .collect(Collectors.toMap(entry -> new 
com.alibaba.dubbo.common.DelegateURL(entry.getKey()),
                         entry -> {
                             return entry.getValue().entrySet()
                                     .stream()
                                     .collect(Collectors.toMap(e -> e.getKey(), 
e -> {
-                                        return e.getValue().stream().map(url 
-> new com.alibaba.dubbo.common.URL(url)).collect(Collectors.toList());
+                                        return e.getValue().stream().map(url 
-> new com.alibaba.dubbo.common.DelegateURL(url)).collect(Collectors.toList());
                                     }));
                         }));
     }
 
 
     public List<com.alibaba.dubbo.common.URL> 
getCacheUrls(com.alibaba.dubbo.common.URL url) {
-        return 
abstractRegistry.lookup(url.getOriginalURL()).stream().map(tmpUrl -> new 
com.alibaba.dubbo.common.URL(tmpUrl)).collect(Collectors.toList());
+        return 
abstractRegistry.lookup(url.getOriginalURL()).stream().map(tmpUrl -> new 
com.alibaba.dubbo.common.DelegateURL(tmpUrl)).collect(Collectors.toList());
     }
 
     public List<com.alibaba.dubbo.common.URL> 
lookup(com.alibaba.dubbo.common.URL url) {
-        return 
abstractRegistry.lookup(url.getOriginalURL()).stream().map(tmpUrl -> new 
com.alibaba.dubbo.common.URL(tmpUrl)).collect(Collectors.toList());
+        return 
abstractRegistry.lookup(url.getOriginalURL()).stream().map(tmpUrl -> new 
com.alibaba.dubbo.common.DelegateURL(tmpUrl)).collect(Collectors.toList());
     }
 
     protected void notify(com.alibaba.dubbo.common.URL url, 
com.alibaba.dubbo.registry.NotifyListener listener, 
List<com.alibaba.dubbo.common.URL> urls) {
@@ -101,22 +101,22 @@ public abstract class AbstractRegistry implements 
Registry {
 
     @Override
     public void register(URL url) {
-        this.register(new com.alibaba.dubbo.common.URL(url));
+        this.register(new com.alibaba.dubbo.common.DelegateURL(url));
     }
 
     @Override
     public void unregister(URL url) {
-        this.unregister(new com.alibaba.dubbo.common.URL(url));
+        this.unregister(new com.alibaba.dubbo.common.DelegateURL(url));
     }
 
     @Override
     public void subscribe(URL url, NotifyListener listener) {
-        this.subscribe(new com.alibaba.dubbo.common.URL(url), new 
com.alibaba.dubbo.registry.NotifyListener.CompatibleNotifyListener(listener));
+        this.subscribe(new com.alibaba.dubbo.common.DelegateURL(url), new 
com.alibaba.dubbo.registry.NotifyListener.CompatibleNotifyListener(listener));
     }
 
     @Override
     public void unsubscribe(URL url, NotifyListener listener) {
-        this.unsubscribe(new com.alibaba.dubbo.common.URL(url), new 
com.alibaba.dubbo.registry.NotifyListener.CompatibleNotifyListener(listener));
+        this.unsubscribe(new com.alibaba.dubbo.common.DelegateURL(url), new 
com.alibaba.dubbo.registry.NotifyListener.CompatibleNotifyListener(listener));
     }
 
     final Set<com.alibaba.dubbo.registry.NotifyListener> 
convertToNotifyListeners(Set<NotifyListener> notifyListeners) {
diff --git 
a/dubbo-compatible/src/main/java/com/alibaba/dubbo/registry/support/AbstractRegistryFactory.java
 
b/dubbo-compatible/src/main/java/com/alibaba/dubbo/registry/support/AbstractRegistryFactory.java
index 231f9b50bd..badd9f082e 100644
--- 
a/dubbo-compatible/src/main/java/com/alibaba/dubbo/registry/support/AbstractRegistryFactory.java
+++ 
b/dubbo-compatible/src/main/java/com/alibaba/dubbo/registry/support/AbstractRegistryFactory.java
@@ -36,6 +36,6 @@ public abstract class AbstractRegistryFactory extends 
org.apache.dubbo.registry.
 
     @Override
     protected Registry createRegistry(URL url) {
-        return createRegistry(new com.alibaba.dubbo.common.URL(url));
+        return createRegistry(new com.alibaba.dubbo.common.DelegateURL(url));
     }
 }
diff --git 
a/dubbo-compatible/src/main/java/com/alibaba/dubbo/registry/support/FailbackRegistry.java
 
b/dubbo-compatible/src/main/java/com/alibaba/dubbo/registry/support/FailbackRegistry.java
index 4182ea65c5..f50c2c1fb4 100644
--- 
a/dubbo-compatible/src/main/java/com/alibaba/dubbo/registry/support/FailbackRegistry.java
+++ 
b/dubbo-compatible/src/main/java/com/alibaba/dubbo/registry/support/FailbackRegistry.java
@@ -16,6 +16,7 @@
  */
 package com.alibaba.dubbo.registry.support;
 
+import com.alibaba.dubbo.common.DelegateURL;
 import com.alibaba.dubbo.common.URL;
 import com.alibaba.dubbo.registry.NotifyListener;
 import com.alibaba.dubbo.registry.Registry;
@@ -87,12 +88,12 @@ public abstract class FailbackRegistry implements 
org.apache.dubbo.registry.Regi
 
     @Override
     public List<URL> lookup(URL url) {
-        return failbackRegistry.lookup(url.getOriginalURL()).stream().map(e -> 
new URL(e)).collect(Collectors.toList());
+        return failbackRegistry.lookup(url.getOriginalURL()).stream().map(e -> 
new DelegateURL(e)).collect(Collectors.toList());
     }
 
     @Override
     public URL getUrl() {
-        return new URL(failbackRegistry.getUrl());
+        return new DelegateURL(failbackRegistry.getUrl());
     }
 
     @Override
@@ -112,22 +113,22 @@ public abstract class FailbackRegistry implements 
org.apache.dubbo.registry.Regi
 
     @Override
     public void register(org.apache.dubbo.common.URL url) {
-        this.register(new URL(url));
+        this.register(new DelegateURL(url));
     }
 
     @Override
     public void unregister(org.apache.dubbo.common.URL url) {
-        this.unregister(new URL(url));
+        this.unregister(new DelegateURL(url));
     }
 
     @Override
     public void subscribe(org.apache.dubbo.common.URL url, 
org.apache.dubbo.registry.NotifyListener listener) {
-        this.subscribe(new URL(url), new 
NotifyListener.CompatibleNotifyListener(listener));
+        this.subscribe(new DelegateURL(url), new 
NotifyListener.CompatibleNotifyListener(listener));
     }
 
     @Override
     public void unsubscribe(org.apache.dubbo.common.URL url, 
org.apache.dubbo.registry.NotifyListener listener) {
-        this.unsubscribe(new URL(url), new 
NotifyListener.CompatibleNotifyListener(listener));
+        this.unsubscribe(new DelegateURL(url), new 
NotifyListener.CompatibleNotifyListener(listener));
     }
 
     @Override
@@ -147,22 +148,22 @@ public abstract class FailbackRegistry implements 
org.apache.dubbo.registry.Regi
 
         @Override
         public void doRegister(org.apache.dubbo.common.URL url) {
-            this.compatibleFailbackRegistry.doRegister(new URL(url));
+            this.compatibleFailbackRegistry.doRegister(new DelegateURL(url));
         }
 
         @Override
         public void doUnregister(org.apache.dubbo.common.URL url) {
-            this.compatibleFailbackRegistry.doUnregister(new URL(url));
+            this.compatibleFailbackRegistry.doUnregister(new DelegateURL(url));
         }
 
         @Override
         public void doSubscribe(org.apache.dubbo.common.URL url, 
org.apache.dubbo.registry.NotifyListener listener) {
-            this.compatibleFailbackRegistry.doSubscribe(new URL(url), new 
NotifyListener.CompatibleNotifyListener(listener));
+            this.compatibleFailbackRegistry.doSubscribe(new DelegateURL(url), 
new NotifyListener.CompatibleNotifyListener(listener));
         }
 
         @Override
         public void doUnsubscribe(org.apache.dubbo.common.URL url, 
org.apache.dubbo.registry.NotifyListener listener) {
-            this.compatibleFailbackRegistry.doUnsubscribe(new URL(url), new 
NotifyListener.CompatibleNotifyListener(listener));
+            this.compatibleFailbackRegistry.doUnsubscribe(new 
DelegateURL(url), new NotifyListener.CompatibleNotifyListener(listener));
         }
 
         @Override
diff --git 
a/dubbo-compatible/src/main/java/com/alibaba/dubbo/remoting/Transporter.java 
b/dubbo-compatible/src/main/java/com/alibaba/dubbo/remoting/Transporter.java
index 3dcc143102..b34aca3232 100644
--- a/dubbo-compatible/src/main/java/com/alibaba/dubbo/remoting/Transporter.java
+++ b/dubbo-compatible/src/main/java/com/alibaba/dubbo/remoting/Transporter.java
@@ -21,6 +21,7 @@ import org.apache.dubbo.common.extension.Adaptive;
 import org.apache.dubbo.remoting.Constants;
 import org.apache.dubbo.remoting.RemotingServer;
 
+import com.alibaba.dubbo.common.DelegateURL;
 import com.alibaba.dubbo.common.URL;
 
 @Deprecated
@@ -32,7 +33,7 @@ public interface Transporter extends 
org.apache.dubbo.remoting.Transporter {
     @Override
     default RemotingServer bind(org.apache.dubbo.common.URL url, 
org.apache.dubbo.remoting.ChannelHandler handler)
             throws org.apache.dubbo.remoting.RemotingException {
-        return bind(new URL(url), new ChannelHandler() {
+        return bind(new DelegateURL(url), new ChannelHandler() {
             @Override
             public void connected(Channel channel) throws RemotingException {
                 try {
diff --git a/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/Invoker.java 
b/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/Invoker.java
index fc38498649..67d30ccdeb 100644
--- a/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/Invoker.java
+++ b/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/Invoker.java
@@ -19,6 +19,7 @@ package com.alibaba.dubbo.rpc;
 
 import org.apache.dubbo.rpc.AsyncRpcResult;
 
+import com.alibaba.dubbo.common.DelegateURL;
 import com.alibaba.dubbo.common.URL;
 
 @Deprecated
@@ -77,7 +78,7 @@ public interface Invoker<T> extends 
org.apache.dubbo.rpc.Invoker<T> {
 
         @Override
         public URL getUrl() {
-            return new URL(invoker.getUrl());
+            return new DelegateURL(invoker.getUrl());
         }
 
         @Override
diff --git a/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/Protocol.java 
b/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/Protocol.java
index d0a1687b25..ba603d6b1b 100644
--- a/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/Protocol.java
+++ b/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/Protocol.java
@@ -19,6 +19,7 @@ package com.alibaba.dubbo.rpc;
 
 import org.apache.dubbo.rpc.ProtocolServer;
 
+import com.alibaba.dubbo.common.DelegateURL;
 import com.alibaba.dubbo.common.URL;
 
 import java.util.Collections;
@@ -38,7 +39,7 @@ public interface Protocol extends 
org.apache.dubbo.rpc.Protocol {
 
     @Override
     default <T> org.apache.dubbo.rpc.Invoker<T> refer(Class<T> aClass, 
org.apache.dubbo.common.URL url) throws RpcException {
-        return this.refer(aClass, new URL(url));
+        return this.refer(aClass, new DelegateURL(url));
     }
 
     @Override
diff --git 
a/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/ProxyFactory.java 
b/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/ProxyFactory.java
index 4c3c51edf8..35ff7f0da9 100644
--- a/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/ProxyFactory.java
+++ b/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/ProxyFactory.java
@@ -42,6 +42,6 @@ public interface ProxyFactory extends 
org.apache.dubbo.rpc.ProxyFactory {
 
     @Override
     default <T> Invoker<T> getInvoker(T proxy, Class<T> type, URL url) throws 
RpcException {
-        return getInvoker(proxy, type, new com.alibaba.dubbo.common.URL(url));
+        return getInvoker(proxy, type, new 
com.alibaba.dubbo.common.DelegateURL(url));
     }
 }
diff --git 
a/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/RpcContext.java 
b/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/RpcContext.java
index d44f33f2b9..4c49bc1793 100644
--- a/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/RpcContext.java
+++ b/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/RpcContext.java
@@ -21,6 +21,7 @@ import org.apache.dubbo.common.utils.CollectionUtils;
 import org.apache.dubbo.rpc.FutureContext;
 
 import com.alibaba.dubbo.common.Constants;
+import com.alibaba.dubbo.common.DelegateURL;
 import com.alibaba.dubbo.common.URL;
 import com.alibaba.dubbo.rpc.protocol.dubbo.FutureAdapter;
 
@@ -134,7 +135,7 @@ public class RpcContext {
         if (CollectionUtils.isNotEmpty(newUrls)) {
             List<URL> urls = new ArrayList<>(newUrls.size());
             for (org.apache.dubbo.common.URL newUrl : newUrls) {
-                urls.add(new URL(newUrl));
+                urls.add(new DelegateURL(newUrl));
             }
             return urls;
         }
@@ -152,7 +153,7 @@ public class RpcContext {
     }
 
     public URL getUrl() {
-        return new URL(newRpcContext.getUrl());
+        return new DelegateURL(newRpcContext.getUrl());
     }
 
     public void setUrl(URL url) {
diff --git 
a/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/cluster/Configurator.java
 
b/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/cluster/Configurator.java
index 9a847ca281..4ebf5f1d74 100644
--- 
a/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/cluster/Configurator.java
+++ 
b/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/cluster/Configurator.java
@@ -37,6 +37,6 @@ public interface Configurator extends 
org.apache.dubbo.rpc.cluster.Configurator
 
     @Override
     default URL configure(URL url) {
-        return this.configure(new com.alibaba.dubbo.common.URL(url));
+        return this.configure(new com.alibaba.dubbo.common.DelegateURL(url));
     }
 }
diff --git 
a/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/cluster/ConfiguratorFactory.java
 
b/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/cluster/ConfiguratorFactory.java
index 087f8c6e8d..888064104d 100644
--- 
a/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/cluster/ConfiguratorFactory.java
+++ 
b/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/cluster/ConfiguratorFactory.java
@@ -28,6 +28,6 @@ public interface ConfiguratorFactory extends 
org.apache.dubbo.rpc.cluster.Config
 
     @Override
     default Configurator getConfigurator(URL url) {
-        return this.getConfigurator(new com.alibaba.dubbo.common.URL(url));
+        return this.getConfigurator(new 
com.alibaba.dubbo.common.DelegateURL(url));
     }
 }
diff --git 
a/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/cluster/LoadBalance.java 
b/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/cluster/LoadBalance.java
index 4c215e4e5f..d0f978afa6 100644
--- 
a/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/cluster/LoadBalance.java
+++ 
b/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/cluster/LoadBalance.java
@@ -22,6 +22,8 @@ import org.apache.dubbo.rpc.Invocation;
 import org.apache.dubbo.rpc.Invoker;
 import org.apache.dubbo.rpc.RpcException;
 
+import com.alibaba.dubbo.common.DelegateURL;
+
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -38,7 +40,9 @@ public interface LoadBalance extends 
org.apache.dubbo.rpc.cluster.LoadBalance {
                 map(invoker -> new 
com.alibaba.dubbo.rpc.Invoker.CompatibleInvoker<T>(invoker)).
                 collect(Collectors.toList());
 
-        return select(invs, new com.alibaba.dubbo.common.URL(url),
-                new 
com.alibaba.dubbo.rpc.Invocation.CompatibleInvocation(invocation));
+        com.alibaba.dubbo.rpc.Invoker<T> selected = select(invs, new 
DelegateURL(url),
+            new 
com.alibaba.dubbo.rpc.Invocation.CompatibleInvocation(invocation));
+
+        return selected == null ? null : selected.getOriginal();
     }
 }
diff --git 
a/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/cluster/Router.java 
b/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/cluster/Router.java
index d8822bcd86..2bc4aabd18 100644
--- a/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/cluster/Router.java
+++ b/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/cluster/Router.java
@@ -23,6 +23,7 @@ import org.apache.dubbo.rpc.Invoker;
 import org.apache.dubbo.rpc.RpcException;
 
 import java.util.List;
+import java.util.Objects;
 import java.util.stream.Collectors;
 
 @Deprecated
@@ -44,9 +45,9 @@ public interface Router extends 
org.apache.dubbo.rpc.cluster.Router{
         List<com.alibaba.dubbo.rpc.Invoker<T>> invs = 
invokers.stream().map(invoker -> new 
com.alibaba.dubbo.rpc.Invoker.CompatibleInvoker<T>(invoker)).
                 collect(Collectors.toList());
 
-        List<com.alibaba.dubbo.rpc.Invoker<T>> res = this.route(invs, new 
com.alibaba.dubbo.common.URL(url), new 
com.alibaba.dubbo.rpc.Invocation.CompatibleInvocation(invocation));
+        List<com.alibaba.dubbo.rpc.Invoker<T>> res = this.route(invs, new 
com.alibaba.dubbo.common.DelegateURL(url), new 
com.alibaba.dubbo.rpc.Invocation.CompatibleInvocation(invocation));
 
-        return res.stream().map(inv -> 
inv.getOriginal()).collect(Collectors.toList());
+        return res.stream().map(inv -> 
inv.getOriginal()).filter(Objects::nonNull).collect(Collectors.toList());
     }
 
     @Override
diff --git 
a/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/cluster/RouterFactory.java
 
b/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/cluster/RouterFactory.java
index e0416b5a3d..f57a0023d5 100644
--- 
a/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/cluster/RouterFactory.java
+++ 
b/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/cluster/RouterFactory.java
@@ -27,6 +27,6 @@ public interface RouterFactory extends 
org.apache.dubbo.rpc.cluster.RouterFactor
 
     @Override
     default Router getRouter(URL url) {
-        return this.getRouter(new com.alibaba.dubbo.common.URL(url));
+        return this.getRouter(new com.alibaba.dubbo.common.DelegateURL(url));
     }
 }
diff --git 
a/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/cluster/RuleConverter.java
 
b/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/cluster/RuleConverter.java
index 0c53e6c7a7..acf6c8797b 100644
--- 
a/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/cluster/RuleConverter.java
+++ 
b/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/cluster/RuleConverter.java
@@ -29,7 +29,7 @@ public interface RuleConverter extends 
org.apache.dubbo.rpc.cluster.RuleConverte
 
     @Override
     default List<URL> convert(URL subscribeUrl, Object source) {
-        return this.convert(new com.alibaba.dubbo.common.URL(subscribeUrl), 
source).
+        return this.convert(new 
com.alibaba.dubbo.common.DelegateURL(subscribeUrl), source).
                 stream().map(url -> 
url.getOriginalURL()).collect(Collectors.toList());
     }
 }

Reply via email to