This is an automated email from the ASF dual-hosted git repository.
albumenj pushed a commit to branch 3.3
in repository https://gitbox.apache.org/repos/asf/dubbo.git
The following commit(s) were added to refs/heads/3.3 by this push:
new 48df310ce7 [Feature] Merge CommonConfigPostProcessor and
ConfigPostProcessor (#14264)
48df310ce7 is described below
commit 48df310ce7e0ec8f6c0f467d5d44b0c760590d7c
Author: heliang666s <[email protected]>
AuthorDate: Fri May 31 16:03:09 2024 +0800
[Feature] Merge CommonConfigPostProcessor and ConfigPostProcessor (#14264)
* [Feature] Merge CommonConfigPostProcessor and ConfigPostProcessor
* [Feature] Merge CommonConfigPostProcessor and ConfigPostProcessor
---
.../dubbo/config/CommonConfigPostProcessor.java | 31 ----------------------
.../apache/dubbo/config/ConfigPostProcessor.java | 3 +--
.../org/apache/dubbo/config/ReferenceConfig.java | 7 ++---
.../org/apache/dubbo/config/ServiceConfig.java | 7 ++---
dubbo-distribution/dubbo-all-shaded/pom.xml | 4 ---
dubbo-distribution/dubbo-all/pom.xml | 4 ---
dubbo-distribution/dubbo-core-spi/pom.xml | 3 ---
7 files changed, 5 insertions(+), 54 deletions(-)
diff --git
a/dubbo-common/src/main/java/org/apache/dubbo/config/CommonConfigPostProcessor.java
b/dubbo-common/src/main/java/org/apache/dubbo/config/CommonConfigPostProcessor.java
deleted file mode 100644
index f3a7e309b7..0000000000
---
a/dubbo-common/src/main/java/org/apache/dubbo/config/CommonConfigPostProcessor.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * 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 org.apache.dubbo.config;
-
-import org.apache.dubbo.common.extension.ExtensionScope;
-import org.apache.dubbo.common.extension.SPI;
-
-/**
- * it will be call when reference or service config refresh
- */
-@SPI(scope = ExtensionScope.MODULE)
-public interface CommonConfigPostProcessor {
-
- default void postProcessReferConfig(ReferenceConfigBase referenceConfig) {}
-
- default void postProcessServiceConfig(ServiceConfigBase serviceConfig) {}
-}
diff --git
a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ConfigPostProcessor.java
b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ConfigPostProcessor.java
index 57daef48df..4bddc9f526 100644
---
a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ConfigPostProcessor.java
+++
b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ConfigPostProcessor.java
@@ -23,9 +23,8 @@ import org.apache.dubbo.common.extension.SPI;
* 2019/12/30
* it will be instead of CommonConfigPostProcessor
*/
-@Deprecated
@SPI(scope = ExtensionScope.MODULE)
-public interface ConfigPostProcessor extends CommonConfigPostProcessor {
+public interface ConfigPostProcessor {
default void postProcessReferConfig(ReferenceConfig referenceConfig) {}
diff --git
a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ReferenceConfig.java
b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ReferenceConfig.java
index c0aad1a209..913785a9c5 100644
---
a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ReferenceConfig.java
+++
b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ReferenceConfig.java
@@ -871,14 +871,11 @@ public class ReferenceConfig<T> extends
ReferenceConfigBase<T> {
private void postProcessConfig() {
List<ConfigPostProcessor> configPostProcessors =
this.getExtensionLoader(ConfigPostProcessor.class)
.getActivateExtension(URL.valueOf("configPostProcessor://"),
(String[]) null);
- List<CommonConfigPostProcessor> commonConfigPostProcessors =
this.getExtensionLoader(
- CommonConfigPostProcessor.class)
- .getActivateExtension(URL.valueOf("configPostProcessor://"),
(String[]) null);
- HashSet<CommonConfigPostProcessor> allConfigPostProcessor = new
HashSet<>();
+ HashSet<ConfigPostProcessor> allConfigPostProcessor = new HashSet<>();
// merge common and old config
- allConfigPostProcessor.addAll(commonConfigPostProcessors);
+ allConfigPostProcessor.addAll(configPostProcessors);
allConfigPostProcessor.addAll(configPostProcessors);
allConfigPostProcessor.forEach(component ->
component.postProcessReferConfig(this));
diff --git
a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ServiceConfig.java
b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ServiceConfig.java
index 53bf3c84e9..363eccd8b5 100644
---
a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ServiceConfig.java
+++
b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ServiceConfig.java
@@ -1000,14 +1000,11 @@ public class ServiceConfig<T> extends
ServiceConfigBase<T> {
private void postProcessConfig() {
List<ConfigPostProcessor> configPostProcessors =
this.getExtensionLoader(ConfigPostProcessor.class)
.getActivateExtension(URL.valueOf("configPostProcessor://",
getScopeModel()), (String[]) null);
- List<CommonConfigPostProcessor> commonConfigPostProcessors =
this.getExtensionLoader(
- CommonConfigPostProcessor.class)
- .getActivateExtension(URL.valueOf("configPostProcessor://"),
(String[]) null);
- HashSet<CommonConfigPostProcessor> allConfigPostProcessor = new
HashSet<>();
+ HashSet<ConfigPostProcessor> allConfigPostProcessor = new HashSet<>();
// merge common and old config
- allConfigPostProcessor.addAll(commonConfigPostProcessors);
+ allConfigPostProcessor.addAll(configPostProcessors);
allConfigPostProcessor.addAll(configPostProcessors);
allConfigPostProcessor.forEach(component ->
component.postProcessServiceConfig(this));
diff --git a/dubbo-distribution/dubbo-all-shaded/pom.xml
b/dubbo-distribution/dubbo-all-shaded/pom.xml
index c259d3b60b..bc7ca34f7f 100644
--- a/dubbo-distribution/dubbo-all-shaded/pom.xml
+++ b/dubbo-distribution/dubbo-all-shaded/pom.xml
@@ -885,10 +885,6 @@
<resource>META-INF/dubbo/internal/org.apache.dubbo.common.json.JsonUtil</resource>
</transformer>
- <transformer
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
-
<resource>META-INF/dubbo/internal/org.apache.dubbo.config.CommonConfigPostProcessor</resource>
- </transformer>
-
<transformer
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/dubbo/internal/org.apache.dubbo.registry.integration.ServiceURLCustomizer</resource>
</transformer>
diff --git a/dubbo-distribution/dubbo-all/pom.xml
b/dubbo-distribution/dubbo-all/pom.xml
index 15de10a518..db8f34bf76 100644
--- a/dubbo-distribution/dubbo-all/pom.xml
+++ b/dubbo-distribution/dubbo-all/pom.xml
@@ -924,10 +924,6 @@
<resource>META-INF/dubbo/internal/org.apache.dubbo.common.json.JsonUtil</resource>
</transformer>
- <transformer
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
-
<resource>META-INF/dubbo/internal/org.apache.dubbo.config.CommonConfigPostProcessor</resource>
- </transformer>
-
<transformer
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/dubbo/internal/org.apache.dubbo.registry.integration.ServiceURLCustomizer</resource>
</transformer>
diff --git a/dubbo-distribution/dubbo-core-spi/pom.xml
b/dubbo-distribution/dubbo-core-spi/pom.xml
index c9661590f2..43511a8c92 100644
--- a/dubbo-distribution/dubbo-core-spi/pom.xml
+++ b/dubbo-distribution/dubbo-core-spi/pom.xml
@@ -523,9 +523,6 @@
<transformer
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/dubbo/internal/org.apache.dubbo.common.json.JsonUtil</resource>
</transformer>
- <transformer
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
-
<resource>META-INF/dubbo/internal/org.apache.dubbo.config.CommonConfigPostProcessor</resource>
- </transformer>
<transformer
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/dubbo/internal/org.apache.dubbo.registry.integration.ServiceURLCustomizer</resource>
</transformer>