AngLi2 commented on a change in pull request #2358:
URL: 
https://github.com/apache/servicecomb-java-chassis/pull/2358#discussion_r619738028



##########
File path: 
dynamic-config/config-kie/src/main/java/org/apache/servicecomb/config/kie/collect/KieCenterDefaultDeploymentProvider.java
##########
@@ -15,44 +15,37 @@
  * limitations under the License.
  */
 
-package org.apache.servicecomb.deployment;
-
-import java.util.Arrays;
+package org.apache.servicecomb.config.kie.collect;
 
+import com.google.common.annotations.VisibleForTesting;
 import org.apache.commons.configuration.AbstractConfiguration;
 import org.apache.servicecomb.config.ConfigUtil;
+import org.apache.servicecomb.deployment.DeploymentProvider;
+import org.apache.servicecomb.deployment.SystemBootstrapInfo;
 
-import com.google.common.annotations.VisibleForTesting;
+import java.util.Arrays;
+
+public class KieCenterDefaultDeploymentProvider implements DeploymentProvider {
+  public static final String SYSTEM_KEY_KIE_CENTER = "KieCenter";
 
-public class DefaultDeploymentProvider implements DeploymentProvider {
   private static AbstractConfiguration configuration = 
ConfigUtil.createLocalConfig();
 
   @Override
   public SystemBootstrapInfo getSystemBootStrapInfo(String systemKey) {
-    switch (systemKey) {
-      case SYSTEM_KEY_SERVICE_CENTER:
-        SystemBootstrapInfo sc = new SystemBootstrapInfo();
-        String[] urls = 
configuration.getStringArray("servicecomb.service.registry.address");
-        if (urls == null || urls.length == 0) {
-          urls = new String[] {"http://127.0.0.1:30100"};
-        }
-        sc.setAccessURL(Arrays.asList(urls));
-        return sc;
-      case SYSTEM_KEY_CONFIG_CENTER:
-        String[] ccAddresses = 
configuration.getStringArray("servicecomb.config.client.serverUri");
-        if (ccAddresses == null || ccAddresses.length == 0) {
+    if (systemKey.contentEquals(SYSTEM_KEY_KIE_CENTER)) {
+      String[] kieAddresses = 
configuration.getStringArray("servicecomb.kie.serverUri");
+      if (kieAddresses == null || kieAddresses.length == 0) {
           return null;
-        }
-        SystemBootstrapInfo cc = new SystemBootstrapInfo();
-        cc.setAccessURL(Arrays.asList(ccAddresses));
-        return cc;
-      default:
-        return null;
+      }
+      SystemBootstrapInfo kie = new SystemBootstrapInfo();
+      kie.setAccessURL(Arrays.asList(kieAddresses));
+      return kie;
     }
+    return null;

Review comment:
       same as above




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to