diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2011-05-19 12:59:50 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2011-05-19 12:59:50 +0000 |
commit | d3c3c29329142b6f05b22c141ae616bb42c773ed (patch) | |
tree | 07b62089e3b14b6140442a6658065c52acf4767e /sca-java-2.x/trunk/modules/core-spi/src | |
parent | f20ddb18c5425b2dae9abc90a8a1c0f3f1d7b71a (diff) |
Move the code for getDomainComposite from NodeImpl to the domain registry
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1124724 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/core-spi/src')
2 files changed, 24 insertions, 0 deletions
diff --git a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BaseDomainRegistry.java b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BaseDomainRegistry.java index bb20ae5337..4e5f81502f 100644 --- a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BaseDomainRegistry.java +++ b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BaseDomainRegistry.java @@ -26,9 +26,15 @@ import java.util.Map; import java.util.concurrent.CopyOnWriteArrayList; import java.util.logging.Logger; +import javax.xml.namespace.QName; + +import org.apache.tuscany.sca.assembly.AssemblyFactory; +import org.apache.tuscany.sca.assembly.Base; +import org.apache.tuscany.sca.assembly.Composite; import org.apache.tuscany.sca.assembly.Endpoint; import org.apache.tuscany.sca.assembly.EndpointReference; import org.apache.tuscany.sca.core.ExtensionPointRegistry; +import org.apache.tuscany.sca.core.FactoryExtensionPoint; import org.apache.tuscany.sca.core.LifeCycleListener; /** @@ -164,4 +170,21 @@ public abstract class BaseDomainRegistry implements DomainRegistry, LifeCycleLis public void removeContributionListener(ContributionListener listener) { contributionlisteners.remove(listener); } + + public Composite getDomainComposite() { + FactoryExtensionPoint factories = registry.getExtensionPoint(FactoryExtensionPoint.class); + AssemblyFactory assemblyFactory = factories.getFactory(AssemblyFactory.class); + Composite domainComposite = assemblyFactory.createComposite(); + domainComposite.setName(new QName(Base.SCA11_TUSCANY_NS, getDomainURI())); + domainComposite.setAutowire(false); + domainComposite.setLocal(false); + List<Composite> domainIncludes = domainComposite.getIncludes(); + Map<String, List<String>> runningCompositeURIs = getRunningCompositeURIs(); + for (String curi : runningCompositeURIs.keySet()) { + for (String compositeURI : runningCompositeURIs.get(curi)) { + domainIncludes.add(getRunningComposite(curi, compositeURI)); + } + } + return domainComposite; + } } diff --git a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DomainRegistry.java b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DomainRegistry.java index 08fbb62f0d..85d5c80d10 100644 --- a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DomainRegistry.java +++ b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DomainRegistry.java @@ -99,4 +99,5 @@ public interface DomainRegistry { String getRunningMember(String contributionURI, String compositeURI); String remoteCommand(String memberName, Callable<String> command); + public Composite getDomainComposite(); } |