diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2010-01-29 11:11:09 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2010-01-29 11:11:09 +0000 |
commit | 59f53a731aeb36de2bac7777cc26f24f6997afb0 (patch) | |
tree | d2bc362a6bb5a80a6ef5859d1968c399f90bcb54 | |
parent | 832d8c662e9fc0ae99066efeedc0bd085a25b663 (diff) |
Update to find an existing domain if the registry isn't explicitly defined
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@904461 13f79535-47bb-0310-9956-ffa450edef68
4 files changed, 16 insertions, 1 deletions
diff --git a/sca-java-2.x/trunk/itest/nodes/one-jvm-hazelcast/src/test/java/itest/TwoRemoteNodesTestCase.java b/sca-java-2.x/trunk/itest/nodes/one-jvm-hazelcast/src/test/java/itest/TwoRemoteNodesTestCase.java index 1c20911da2..7e3cf0c3e6 100644 --- a/sca-java-2.x/trunk/itest/nodes/one-jvm-hazelcast/src/test/java/itest/TwoRemoteNodesTestCase.java +++ b/sca-java-2.x/trunk/itest/nodes/one-jvm-hazelcast/src/test/java/itest/TwoRemoteNodesTestCase.java @@ -64,7 +64,7 @@ public class TwoRemoteNodesTestCase{ // assertNotNull(scaClientService);
// assertEquals("Hello Petra", scaClientService.sayHello("Petra"));
- Helloworld scaClientClient = SCAClientFactory.newInstance(URI.create("tuscany:TwoRemoteNodesTestCase")).getService(Helloworld.class, "HelloworldClient");
+ Helloworld scaClientClient = SCAClientFactory.newInstance(URI.create("TwoRemoteNodesTestCase")).getService(Helloworld.class, "HelloworldClient");
assertNotNull(scaClientClient);
assertEquals("Hi Hello Petra", scaClientClient.sayHello("Petra"));
diff --git a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BaseEndpointRegistry.java b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BaseEndpointRegistry.java index 5646916075..8cea5e1423 100644 --- a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BaseEndpointRegistry.java +++ b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BaseEndpointRegistry.java @@ -199,4 +199,8 @@ public abstract class BaseEndpointRegistry implements EndpointRegistry, LifeCycl listeners.remove(listener); } + public String getDomainName() { + return domainURI; + } + } diff --git a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointRegistry.java b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointRegistry.java index 6c4839018d..0c0c0f2b0e 100644 --- a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointRegistry.java +++ b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointRegistry.java @@ -66,4 +66,5 @@ public interface EndpointRegistry { void addListener(EndpointListener listener); void removeListener(EndpointListener listener); + String getDomainName(); } diff --git a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ExtensibleDomainRegistry.java b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ExtensibleDomainRegistry.java index 0a0b503206..62ba7cce8d 100644 --- a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ExtensibleDomainRegistry.java +++ b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ExtensibleDomainRegistry.java @@ -64,6 +64,16 @@ public class ExtensibleDomainRegistry implements DomainRegistryFactory { URI uri = URI.create(endpointRegistryURI); String scheme = uri.getScheme(); if (scheme == null) { + + // See if there is a previously created registry for that domain + for (DomainRegistryFactory factory : factories.getDomainRegistryFactories()) { + for (EndpointRegistry endpointRegistry : factory.getEndpointRegistries()) { + if (endpointRegistry.getDomainName().equals(domainURI)) { + return endpointRegistry; + } + } + } + scheme = "vm"; endpointRegistryURI = "vm:" + endpointRegistryURI; } else { |