summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/core-spi/src
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2010-01-29 11:11:09 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2010-01-29 11:11:09 +0000
commit59f53a731aeb36de2bac7777cc26f24f6997afb0 (patch)
treed2bc362a6bb5a80a6ef5859d1968c399f90bcb54 /sca-java-2.x/trunk/modules/core-spi/src
parent832d8c662e9fc0ae99066efeedc0bd085a25b663 (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
Diffstat (limited to 'sca-java-2.x/trunk/modules/core-spi/src')
-rw-r--r--sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BaseEndpointRegistry.java4
-rw-r--r--sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointRegistry.java1
-rw-r--r--sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ExtensibleDomainRegistry.java10
3 files changed, 15 insertions, 0 deletions
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 {