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

huxing pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-dubbo.git


The following commit(s) were added to refs/heads/master by this push:
     new a0f3408  Revert #3688 config-center-config (#3853)
a0f3408 is described below

commit a0f34086f2c7444fd4bcdf72f7ab577ec2e25fa6
Author: ken.lj <[email protected]>
AuthorDate: Fri Apr 12 11:49:17 2019 +0800

    Revert #3688 config-center-config (#3853)
---
 .../java/org/apache/dubbo/config/ConfigCenterConfig.java | 16 ++++++++--------
 .../java/org/apache/dubbo/config/support/Parameter.java  | 15 +++++++++++++++
 2 files changed, 23 insertions(+), 8 deletions(-)

diff --git 
a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ConfigCenterConfig.java
 
b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ConfigCenterConfig.java
index 4b88702..45677bf 100644
--- 
a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ConfigCenterConfig.java
+++ 
b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ConfigCenterConfig.java
@@ -95,7 +95,7 @@ public class ConfigCenterConfig extends AbstractConfig {
         this.address = address;
     }
 
-    @Parameter(key = Constants.CONFIG_CLUSTER_KEY)
+    @Parameter(key = Constants.CONFIG_CLUSTER_KEY, useKeyAsProperty = false)
     public String getCluster() {
         return cluster;
     }
@@ -104,7 +104,7 @@ public class ConfigCenterConfig extends AbstractConfig {
         this.cluster = cluster;
     }
 
-    @Parameter(key = Constants.CONFIG_NAMESPACE_KEY)
+    @Parameter(key = Constants.CONFIG_NAMESPACE_KEY, useKeyAsProperty = false)
     public String getNamespace() {
         return namespace;
     }
@@ -113,7 +113,7 @@ public class ConfigCenterConfig extends AbstractConfig {
         this.namespace = namespace;
     }
 
-    @Parameter(key = Constants.CONFIG_GROUP_KEY)
+    @Parameter(key = Constants.CONFIG_GROUP_KEY, useKeyAsProperty = false)
     public String getGroup() {
         return group;
     }
@@ -122,7 +122,7 @@ public class ConfigCenterConfig extends AbstractConfig {
         this.group = group;
     }
 
-    @Parameter(key = Constants.CONFIG_CHECK_KEY)
+    @Parameter(key = Constants.CONFIG_CHECK_KEY, useKeyAsProperty = false)
     public Boolean isCheck() {
         return check;
     }
@@ -131,7 +131,7 @@ public class ConfigCenterConfig extends AbstractConfig {
         this.check = check;
     }
 
-    @Parameter(key = Constants.CONFIG_ENABLE_KEY)
+    @Parameter(key = Constants.CONFIG_ENABLE_KEY, useKeyAsProperty = false)
     public Boolean isHighestPriority() {
         return highestPriority;
     }
@@ -156,7 +156,7 @@ public class ConfigCenterConfig extends AbstractConfig {
         this.password = password;
     }
 
-    @Parameter(key = Constants.CONFIG_TIMEOUT_KEY)
+    @Parameter(key = Constants.CONFIG_TIMEOUT_KEY, useKeyAsProperty = false)
     public Long getTimeout() {
         return timeout;
     }
@@ -165,7 +165,7 @@ public class ConfigCenterConfig extends AbstractConfig {
         this.timeout = timeout;
     }
 
-    @Parameter(key = Constants.CONFIG_CONFIGFILE_KEY)
+    @Parameter(key = Constants.CONFIG_CONFIGFILE_KEY, useKeyAsProperty = false)
     public String getConfigFile() {
         return configFile;
     }
@@ -183,7 +183,7 @@ public class ConfigCenterConfig extends AbstractConfig {
         this.appConfigFile = appConfigFile;
     }
 
-    @Parameter(key = Constants.CONFIG_APPNAME_KEY)
+    @Parameter(key = Constants.CONFIG_APPNAME_KEY, useKeyAsProperty = false)
     public String getAppName() {
         return appName;
     }
diff --git 
a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/support/Parameter.java
 
b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/support/Parameter.java
index 029a491..c6ece12 100644
--- 
a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/support/Parameter.java
+++ 
b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/support/Parameter.java
@@ -42,6 +42,21 @@ public @interface Parameter {
 
     boolean append() default false;
 
+    /**
+     * if {@link #key()} is specified, it will be used as the key for the 
annotated property when generating url.
+     * by default, this key will also be used to retrieve the config value:
+     * <pre>
+     * {@code
+     *  class ExampleConfig {
+     *      // Dubbo will try to get "dubbo.example.alias_for_item=xxx" from 
.properties, if you want to use the original property
+     *      // "dubbo.example.item=xxx", you need to set 
useKeyAsProperty=false.
+     *      @Parameter(key = "alias_for_item")
+     *      public getItem();
+     *  }
+     * }
+     *
+     * </pre>
+     */
     boolean useKeyAsProperty() default true;
 
 }
\ No newline at end of file

Reply via email to