You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by al...@apache.org on 2021/09/16 04:50:23 UTC

[dubbo] branch 3.0 updated: Add ModelName for ScopeModel (#8819)

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

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


The following commit(s) were added to refs/heads/3.0 by this push:
     new 2d1665f  Add ModelName for ScopeModel (#8819)
2d1665f is described below

commit 2d1665fa318073152e4fa8c83ae8710bca1651fe
Author: Albumen Kevin <jh...@gmail.com>
AuthorDate: Thu Sep 16 12:50:15 2021 +0800

    Add ModelName for ScopeModel (#8819)
---
 .../main/java/org/apache/dubbo/rpc/model/ScopeModel.java   | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/dubbo-common/src/main/java/org/apache/dubbo/rpc/model/ScopeModel.java b/dubbo-common/src/main/java/org/apache/dubbo/rpc/model/ScopeModel.java
index 145ac58..6b3c22c 100644
--- a/dubbo-common/src/main/java/org/apache/dubbo/rpc/model/ScopeModel.java
+++ b/dubbo-common/src/main/java/org/apache/dubbo/rpc/model/ScopeModel.java
@@ -52,6 +52,11 @@ public abstract class ScopeModel implements ExtensionAccessor {
      */
     private String internalName;
 
+    /**
+     * Public Model Name, can be set from user
+     */
+    private String modelName;
+
     private Set<ClassLoader> classLoaders;
 
     private final ScopeModel parent;
@@ -154,6 +159,7 @@ public abstract class ScopeModel implements ExtensionAccessor {
 
     protected void setInternalName(String internalName) {
         this.internalName = internalName;
+        this.modelName = internalName;
     }
 
     public void addClassLoader(ClassLoader classLoader) {
@@ -202,4 +208,12 @@ public abstract class ScopeModel implements ExtensionAccessor {
             return type + "-" + childIndex;
         }
     }
+
+    public String getModelName() {
+        return modelName;
+    }
+
+    public void setModelName(String modelName) {
+        this.modelName = modelName;
+    }
 }