diff options
Diffstat (limited to 'sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany')
3 files changed, 13 insertions, 13 deletions
diff --git a/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/Node.java b/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/Node.java index a5125332fe..7cb76f4a76 100644 --- a/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/Node.java +++ b/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/Node.java @@ -216,12 +216,10 @@ public interface Node { <T> T getService(Class<T> interfaze, String serviceURI) throws NoSuchServiceException; /** - * Get the URIs of any composites that have been started for a contribution - * @param contributionURI the contribution URI - * @return the List of started composite URIs + * Get the URIs of any composites that have been started in the domain + * @return a map with key contributionURI and value a list of the started compositeURIs */ -// List<String> getStartedCompositeURIs(String contributionURI); - Map<String, List<QName>> getStartedComposites(); + Map<String, List<String>> getStartedCompositeURIs(); /** * Get the URIs of all the contributions installed on this Node diff --git a/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/DeployedComposite.java b/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/DeployedComposite.java index 3ac55ceac7..5a72906e1e 100644 --- a/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/DeployedComposite.java +++ b/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/DeployedComposite.java @@ -83,7 +83,9 @@ public class DeployedComposite { Monitor monitor = deployer.createMonitor(); builtComposite = deployer.build(contributions, dependedOnContributions, new HashMap<QName, List<String>>(), monitor); + // TODO: Ideally deployer.build would set the name and uri to what this needs builtComposite.setName(composite.getName()); + builtComposite.setURI(composite.getURI()); monitor.analyzeProblems(); compositeContext = new CompositeContext(extensionPointRegistry, @@ -101,7 +103,7 @@ public class DeployedComposite { } public void stop() throws ActivationException { - domainRegistry.removeRunningComposite(contribution.getURI(), builtComposite.getName()); + domainRegistry.removeRunningComposite(contribution.getURI(), builtComposite.getURI()); compositeActivator.stop(compositeContext, builtComposite); compositeActivator.deactivate(builtComposite); } diff --git a/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java b/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java index da531a4453..4e821734ce 100644 --- a/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java +++ b/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java @@ -22,6 +22,7 @@ package org.apache.tuscany.sca.impl; import java.io.Reader; import java.io.StringReader; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -218,9 +219,8 @@ public class NodeImpl implements Node { } } - // TODO: should this be composite uri instead of QName? - public Map<String, List<QName>> getStartedComposites() { - return domainRegistry.getRunningCompositeNames(); + public Map<String, List<String>> getStartedCompositeURIs() { + return Collections.unmodifiableMap(domainRegistry.getRunningCompositeURIs()); } public void startComposite(String contributionURI, String compositeURI) throws ActivationException, ValidationException, ContributionReadException { @@ -265,10 +265,10 @@ public class NodeImpl implements Node { domainComposite.setAutowire(false); domainComposite.setLocal(false); List<Composite> domainIncludes = domainComposite.getIncludes(); - Map<String, List<QName>> runningComposites = domainRegistry.getRunningCompositeNames(); - for (String curi : runningComposites.keySet()) { - for (QName name : runningComposites.get(curi)) { - domainIncludes.add(domainRegistry.getRunningComposite(curi, name)); + Map<String, List<String>> runningCompositeURIs = domainRegistry.getRunningCompositeURIs(); + for (String curi : runningCompositeURIs.keySet()) { + for (String compositeURI : runningCompositeURIs.get(curi)) { + domainIncludes.add(domainRegistry.getRunningComposite(curi, compositeURI)); } } return domainComposite; |