diff options
Diffstat (limited to '')
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 { |