summaryrefslogtreecommitdiffstats
path: root/java/sca/modules/endpoint-tribes
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-11-13 21:49:15 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-11-13 21:49:15 +0000
commit4dcff7533534e4b634b349a1105c7862d1655405 (patch)
tree61674abfb88ba63870bec8576101dc3d222454fa /java/sca/modules/endpoint-tribes
parentc6a1c369e49090b6b9a6f2448045740a368c7ca3 (diff)
Replace RuntimeWire with RuntimeEnpoint/RuntimeEndpointReference as the owner of invocaiton chains
(http://www.mail-archive.com/dev@tuscany.apache.org/msg07856.html) git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@836009 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/endpoint-tribes')
-rw-r--r--java/sca/modules/endpoint-tribes/src/main/java/org/apache/tuscany/sca/endpoint/tribes/ReplicatedEndpointRegistry.java7
-rw-r--r--java/sca/modules/endpoint-tribes/src/test/java/org/apache/tuscany/sca/endpoint/tribes/ReplicatedEndpointRegistryTestCase.java3
2 files changed, 6 insertions, 4 deletions
diff --git a/java/sca/modules/endpoint-tribes/src/main/java/org/apache/tuscany/sca/endpoint/tribes/ReplicatedEndpointRegistry.java b/java/sca/modules/endpoint-tribes/src/main/java/org/apache/tuscany/sca/endpoint/tribes/ReplicatedEndpointRegistry.java
index 1b761ca8bc..ef002d5230 100644
--- a/java/sca/modules/endpoint-tribes/src/main/java/org/apache/tuscany/sca/endpoint/tribes/ReplicatedEndpointRegistry.java
+++ b/java/sca/modules/endpoint-tribes/src/main/java/org/apache/tuscany/sca/endpoint/tribes/ReplicatedEndpointRegistry.java
@@ -51,6 +51,7 @@ import org.apache.tuscany.sca.endpoint.tribes.AbstractReplicatedMap.MapEntry;
import org.apache.tuscany.sca.endpoint.tribes.MapStore.MapListener;
import org.apache.tuscany.sca.runtime.EndpointListener;
import org.apache.tuscany.sca.runtime.EndpointRegistry;
+import org.apache.tuscany.sca.runtime.RuntimeEndpoint;
/**
* A replicated EndpointRegistry based on Apache Tomcat Tribes
@@ -291,7 +292,7 @@ public class ReplicatedEndpointRegistry implements EndpointRegistry, LifeCycleLi
endpoint.setRemote(true);
}
// if (!entry.isPrimary()) {
- endpoint.setExtensionPointRegistry(registry);
+ ((RuntimeEndpoint) endpoint).bind(registry, this);
// }
foundEndpoints.add(endpoint);
logger.fine("Found endpoint with matching service - " + endpoint);
@@ -359,7 +360,7 @@ public class ReplicatedEndpointRegistry implements EndpointRegistry, LifeCycleLi
logger.info(id + " Remote endpoint added: " + entry.getValue());
newEp.setRemote(true);
}
- newEp.setExtensionPointRegistry(registry);
+ ((RuntimeEndpoint) newEp).bind(registry, this);
for (EndpointListener listener : listeners) {
listener.endpointAdded(newEp);
}
@@ -384,7 +385,7 @@ public class ReplicatedEndpointRegistry implements EndpointRegistry, LifeCycleLi
}
Endpoint oldEp = (Endpoint)oldEntry.getValue();
Endpoint newEp = (Endpoint)newEntry.getValue();
- newEp.setExtensionPointRegistry(registry);
+ ((RuntimeEndpoint) newEp).bind(registry, this);
for (EndpointListener listener : listeners) {
listener.endpointUpdated(oldEp, newEp);
}
diff --git a/java/sca/modules/endpoint-tribes/src/test/java/org/apache/tuscany/sca/endpoint/tribes/ReplicatedEndpointRegistryTestCase.java b/java/sca/modules/endpoint-tribes/src/test/java/org/apache/tuscany/sca/endpoint/tribes/ReplicatedEndpointRegistryTestCase.java
index a574ba9328..28158d55f5 100644
--- a/java/sca/modules/endpoint-tribes/src/test/java/org/apache/tuscany/sca/endpoint/tribes/ReplicatedEndpointRegistryTestCase.java
+++ b/java/sca/modules/endpoint-tribes/src/test/java/org/apache/tuscany/sca/endpoint/tribes/ReplicatedEndpointRegistryTestCase.java
@@ -23,6 +23,7 @@ import org.apache.tuscany.sca.assembly.AssemblyFactory;
import org.apache.tuscany.sca.assembly.Endpoint;
import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
import org.apache.tuscany.sca.core.FactoryExtensionPoint;
+import org.apache.tuscany.sca.runtime.RuntimeEndpoint;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
@@ -42,7 +43,7 @@ public class ReplicatedEndpointRegistryTestCase {
Endpoint e1 = assemblyFactory.createEndpoint();
e1.setURI("e1uri");
- e1.setExtensionPointRegistry(extensionPoints);
+ ((RuntimeEndpoint) e1).bind(extensionPoints, ep1);
ep1.addEndpoint(e1);
Endpoint e1p = ep1.getEndpoint("e1uri");