tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rf...@apache.org
Subject svn commit: r896261 - in /tuscany/sca-java-2.x/trunk/modules: endpoint-dht/src/main/java/org/apache/tuscany/sca/endpoint/dht/OverlayEndpointRegistry.java endpoint-zookeeper/src/main/java/org/apache/tuscany/sca/endpoint/zookeeper/DistributedRegistry.java
Date Tue, 05 Jan 2010 23:01:30 GMT
Author: rfeng
Date: Tue Jan  5 23:01:06 2010
New Revision: 896261

URL: http://svn.apache.org/viewvc?rev=896261&view=rev
Log:
Add getEndpointReferences

Modified:
    tuscany/sca-java-2.x/trunk/modules/endpoint-dht/src/main/java/org/apache/tuscany/sca/endpoint/dht/OverlayEndpointRegistry.java
    tuscany/sca-java-2.x/trunk/modules/endpoint-zookeeper/src/main/java/org/apache/tuscany/sca/endpoint/zookeeper/DistributedRegistry.java

Modified: tuscany/sca-java-2.x/trunk/modules/endpoint-dht/src/main/java/org/apache/tuscany/sca/endpoint/dht/OverlayEndpointRegistry.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/endpoint-dht/src/main/java/org/apache/tuscany/sca/endpoint/dht/OverlayEndpointRegistry.java?rev=896261&r1=896260&r2=896261&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/endpoint-dht/src/main/java/org/apache/tuscany/sca/endpoint/dht/OverlayEndpointRegistry.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/endpoint-dht/src/main/java/org/apache/tuscany/sca/endpoint/dht/OverlayEndpointRegistry.java
Tue Jan  5 23:01:06 2010
@@ -327,4 +327,8 @@
 	}
     }
 
+    public List<EndpointReference> getEndpointReferences() {
+        return endpointreferences;
+    }
+
 }

Modified: tuscany/sca-java-2.x/trunk/modules/endpoint-zookeeper/src/main/java/org/apache/tuscany/sca/endpoint/zookeeper/DistributedRegistry.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/endpoint-zookeeper/src/main/java/org/apache/tuscany/sca/endpoint/zookeeper/DistributedRegistry.java?rev=896261&r1=896260&r2=896261&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/endpoint-zookeeper/src/main/java/org/apache/tuscany/sca/endpoint/zookeeper/DistributedRegistry.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/endpoint-zookeeper/src/main/java/org/apache/tuscany/sca/endpoint/zookeeper/DistributedRegistry.java
Tue Jan  5 23:01:06 2010
@@ -53,6 +53,8 @@
     private ExtensionPointRegistry registry;
     private String domainURI;
     private String registryURI;
+    private String hosts = null;
+    private int sessionTimeout = 100;
 
     /**
      * 
@@ -64,12 +66,17 @@
         super(null, null, null);
         this.domainURI = domainURI;
         this.registryURI = domainRegistryURI;
-        Map<String, String> config = parseURI(attributes, domainRegistryURI);
+        Map<String, String> config = parseURI(attributes, registryURI);
+        hosts = config.get("hosts");
+        String timeout = config.get("sessionTimeout");
+        if (timeout != null) {
+            sessionTimeout = Integer.parseInt(timeout.trim());
+        }
     }
 
     public void start() {
         try {
-            zooKeeper = new ZooKeeper(registryURI, 100, null);
+            zooKeeper = new ZooKeeper(registryURI, sessionTimeout, null);
         } catch (IOException e) {
             throw new ServiceRuntimeException(e);
         }
@@ -188,7 +195,7 @@
                 logger.fine("Matching against - " + endpoint);
                 if (matches(targetEndpoint.getURI(), endpoint.getURI())) {
                     // if (!entry.isPrimary()) {
-                    ((RuntimeEndpoint) endpoint).bind(registry, this);
+                    ((RuntimeEndpoint)endpoint).bind(registry, this);
                     // }
                     foundEndpoints.add(endpoint);
                     logger.fine("Found endpoint with matching service  - " + endpoint);
@@ -242,7 +249,7 @@
     }
 
     public void entryAdded(Endpoint value) {
-        ((RuntimeEndpoint) value).bind(registry, this);
+        ((RuntimeEndpoint)value).bind(registry, this);
         for (EndpointListener listener : listeners) {
             listener.endpointAdded(value);
         }
@@ -255,7 +262,7 @@
     }
 
     public void entryUpdated(Endpoint oldEp, Endpoint newEp) {
-        ((RuntimeEndpoint) newEp).bind(registry, this);
+        ((RuntimeEndpoint)newEp).bind(registry, this);
         for (EndpointListener listener : listeners) {
             listener.endpointUpdated(oldEp, newEp);
         }
@@ -282,4 +289,8 @@
         }
     }
 
+    public List<EndpointReference> getEndpointReferences() {
+        return endpointreferences;
+    }
+
 }



Mime
View raw message