tamaya-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anat...@apache.org
Subject [2/3] incubator-tamaya git commit: TAMAYA-133: Added tamaya prefix for system and env properties.
Date Fri, 08 Jan 2016 11:52:33 GMT
TAMAYA-133: Added tamaya prefix for system and env properties.


Project: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/commit/895dfd84
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/tree/895dfd84
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/diff/895dfd84

Branch: refs/heads/master
Commit: 895dfd84da356ce04bc5a3bb0d51207205f56eb5
Parents: 66c28e8
Author: anatole <anatole@apache.org>
Authored: Fri Jan 8 12:51:18 2016 +0100
Committer: anatole <anatole@apache.org>
Committed: Fri Jan 8 12:51:18 2016 +0100

----------------------------------------------------------------------
 .../org/apache/tamaya/etcd/EtcdPropertySource.java  | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/895dfd84/modules/integration/etcd/src/main/java/org/apache/tamaya/etcd/EtcdPropertySource.java
----------------------------------------------------------------------
diff --git a/modules/integration/etcd/src/main/java/org/apache/tamaya/etcd/EtcdPropertySource.java
b/modules/integration/etcd/src/main/java/org/apache/tamaya/etcd/EtcdPropertySource.java
index 3784a38..64e9c6d 100644
--- a/modules/integration/etcd/src/main/java/org/apache/tamaya/etcd/EtcdPropertySource.java
+++ b/modules/integration/etcd/src/main/java/org/apache/tamaya/etcd/EtcdPropertySource.java
@@ -32,21 +32,27 @@ import java.util.logging.Logger;
 public class EtcdPropertySource implements PropertySource{
     private static final Logger LOG = Logger.getLogger(EtcdPropertySource.class.getName());
     private List<EtcdAccessor> etcdBackends = new ArrayList<>();
-    private String prefix = System.getProperty("etcd.prefix", "");
+    private String prefix = System.getProperty("tamaya.etcd.prefix", "");
 
     public EtcdPropertySource(){
         int timeout = 2;
-        String val = System.getProperty("etcd.timeout");
+        String val = System.getProperty("tamaya.etcd.timeout");
         if(val == null){
-            val = System.getenv("etcd.timeout");
+            val = System.getenv("tamaya.etcd.timeout");
         }
         if(val!=null){
             timeout = Integer.parseInt(val);
         }
-        String serverURLs = System.getProperty("etcd.server.urls", "http://127.0.0.1:4001");
+        String serverURLs = System.getProperty("tamaya.etcd.server.urls");
+        if(serverURLs==null){
+            serverURLs = System.getenv("tamaya.etcd.server.urls");
+        }
+        if(serverURLs==null){
+            serverURLs = "http://127.0.0.1:4001";
+        }
         for(String url:serverURLs.split("\\,")) {
             try{
-                etcdBackends.add(new EtcdAccessor(url, timeout));
+                etcdBackends.add(new EtcdAccessor(url.trim(), timeout));
                 LOG.info("Using etcd endoint: " + url);
             } catch(Exception e){
                 LOG.log(Level.SEVERE, "Error initializing etcd accessor for URL: " + url,
e);


Mime
View raw message