summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2010-01-05 23:01:06 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2010-01-05 23:01:06 +0000
commit7100b31b4fc3501b6c465dbc977548a386d323cf (patch)
tree384ebf4f8e1c7ebaf2509a3b630757fc1e7f0091 /sca-java-2.x/trunk/modules
parent83a03558455f4deb93628741ad91e7d063518e56 (diff)
Add getEndpointReferences
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@896261 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r--sca-java-2.x/trunk/modules/endpoint-dht/src/main/java/org/apache/tuscany/sca/endpoint/dht/OverlayEndpointRegistry.java4
-rw-r--r--sca-java-2.x/trunk/modules/endpoint-zookeeper/src/main/java/org/apache/tuscany/sca/endpoint/zookeeper/DistributedRegistry.java21
2 files changed, 20 insertions, 5 deletions
diff --git a/sca-java-2.x/trunk/modules/endpoint-dht/src/main/java/org/apache/tuscany/sca/endpoint/dht/OverlayEndpointRegistry.java b/sca-java-2.x/trunk/modules/endpoint-dht/src/main/java/org/apache/tuscany/sca/endpoint/dht/OverlayEndpointRegistry.java
index 015cf64c39..f6fa1f3bfb 100644
--- a/sca-java-2.x/trunk/modules/endpoint-dht/src/main/java/org/apache/tuscany/sca/endpoint/dht/OverlayEndpointRegistry.java
+++ b/sca-java-2.x/trunk/modules/endpoint-dht/src/main/java/org/apache/tuscany/sca/endpoint/dht/OverlayEndpointRegistry.java
@@ -327,4 +327,8 @@ public class OverlayEndpointRegistry implements EndpointRegistry, LifeCycleListe
}
}
+ public List<EndpointReference> getEndpointReferences() {
+ return endpointreferences;
+ }
+
}
diff --git a/sca-java-2.x/trunk/modules/endpoint-zookeeper/src/main/java/org/apache/tuscany/sca/endpoint/zookeeper/DistributedRegistry.java b/sca-java-2.x/trunk/modules/endpoint-zookeeper/src/main/java/org/apache/tuscany/sca/endpoint/zookeeper/DistributedRegistry.java
index b6ec34fe1f..b000640e18 100644
--- a/sca-java-2.x/trunk/modules/endpoint-zookeeper/src/main/java/org/apache/tuscany/sca/endpoint/zookeeper/DistributedRegistry.java
+++ b/sca-java-2.x/trunk/modules/endpoint-zookeeper/src/main/java/org/apache/tuscany/sca/endpoint/zookeeper/DistributedRegistry.java
@@ -53,6 +53,8 @@ public class DistributedRegistry extends AbstractDistributedMap<Endpoint> implem
private ExtensionPointRegistry registry;
private String domainURI;
private String registryURI;
+ private String hosts = null;
+ private int sessionTimeout = 100;
/**
*
@@ -64,12 +66,17 @@ public class DistributedRegistry extends AbstractDistributedMap<Endpoint> implem
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 @@ public class DistributedRegistry extends AbstractDistributedMap<Endpoint> implem
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 class DistributedRegistry extends AbstractDistributedMap<Endpoint> implem
}
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 class DistributedRegistry extends AbstractDistributedMap<Endpoint> implem
}
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 class DistributedRegistry extends AbstractDistributedMap<Endpoint> implem
}
}
+ public List<EndpointReference> getEndpointReferences() {
+ return endpointreferences;
+ }
+
}