You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by li...@apache.org on 2021/11/04 14:32:36 UTC

[dubbo] 02/02: add new files

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

liujun pushed a commit to branch 3.0-metadata-refactor
in repository https://gitbox.apache.org/repos/asf/dubbo.git

commit 2ff8617d8e20faafbb5504461d4a2340fcaf137d
Author: ken.lj <ke...@gmail.com>
AuthorDate: Thu Nov 4 22:32:01 2021 +0800

    add new files
---
 .../dubbo/metadata/report}/MetadataReportInstance.java | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/metadata/MetadataReportInstance.java b/dubbo-metadata/dubbo-metadata-api/src/main/java/org/apache/dubbo/metadata/report/MetadataReportInstance.java
similarity index 86%
rename from dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/metadata/MetadataReportInstance.java
rename to dubbo-metadata/dubbo-metadata-api/src/main/java/org/apache/dubbo/metadata/report/MetadataReportInstance.java
index 75be9cc..937fea2 100644
--- a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/metadata/MetadataReportInstance.java
+++ b/dubbo-metadata/dubbo-metadata-api/src/main/java/org/apache/dubbo/metadata/report/MetadataReportInstance.java
@@ -14,13 +14,12 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.dubbo.config.metadata;
+package org.apache.dubbo.metadata.report;
 
 import org.apache.dubbo.common.URL;
 import org.apache.dubbo.common.URLBuilder;
+import org.apache.dubbo.common.resource.Disposable;
 import org.apache.dubbo.config.MetadataReportConfig;
-import org.apache.dubbo.metadata.report.MetadataReport;
-import org.apache.dubbo.metadata.report.MetadataReportFactory;
 import org.apache.dubbo.rpc.model.ApplicationModel;
 
 import java.util.HashMap;
@@ -33,9 +32,11 @@ import static org.apache.dubbo.common.constants.CommonConstants.DEFAULT_KEY;
 import static org.apache.dubbo.metadata.report.support.Constants.METADATA_REPORT_KEY;
 
 /**
- * 2019-08-09
+ * Repository of MetadataReport instances that can talk to remote metadata server.
+ *
+ * MetadataReport instances are initiated during the beginning of deployer.start() and used by components that need to interact with metadata server.
  */
-public class MetadataReportInstance {
+public class MetadataReportInstance implements Disposable {
 
     private AtomicBoolean init = new AtomicBoolean(false);
 
@@ -90,4 +91,11 @@ public class MetadataReportInstance {
         }
     }
 
+    @Override
+    public void destroy() {
+        metadataReports.forEach((_k, reporter) -> {
+//            reporter.destroy();
+        });
+        metadataReports.clear();
+    }
 }