diff options
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(); } |