diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2011-05-12 11:54:25 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2011-05-12 11:54:25 +0000 |
commit | f9c514bfc502606b4c8c7cb765276a5148910c6a (patch) | |
tree | 26a4b226f87402463cd4cb68008450be98f79a4e /sca-java-2.x/trunk/modules/domain-node/src/main | |
parent | ed95e8719dc29d943884fcfea32b6d9a745a9fd2 (diff) |
Update the registry to use a single class for all the installed contribution attributes, and to correct the storing of running composites to be qualified by the contribution uri. As per a previous commit comment this is still work in progress so a little rough, but its getting closer now to show the type of thing thats needed
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1102252 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/domain-node/src/main')
2 files changed, 17 insertions, 6 deletions
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 1b3b244d08..ca09979501 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 @@ -101,11 +101,11 @@ public class DeployedComposite { public void start() throws ActivationException { compositeActivator.activate(compositeContext, builtComposite); compositeActivator.start(compositeContext, builtComposite); - endpointRegistry.addRunningComposite(builtComposite); + endpointRegistry.addRunningComposite(installedContribution.getURI(), builtComposite); } public void stop() throws ActivationException { - endpointRegistry.removeRunningComposite(builtComposite.getName()); + endpointRegistry.removeRunningComposite(installedContribution.getURI(), builtComposite.getName()); 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 fc7cf43711..d97ad336b2 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 @@ -108,7 +108,10 @@ public class NodeImpl implements Node { uri = getDefaultContributionURI(contributionURL); } // TODO: sort out deployables and exports - endpointRegistry.installContribution(uri, contributionURL, null, null); + org.apache.tuscany.sca.runtime.InstalledContribution ic = new org.apache.tuscany.sca.runtime.InstalledContribution(); + ic.setURI(uri); + ic.setURL(contributionURL); + endpointRegistry.installContribution(ic); if (startDeployables) { // TODO: sort out metadata and dependents in distributed localInstall(uri, contributionURL, metaDataURL, dependentContributionURIs, startDeployables); @@ -202,7 +205,12 @@ public class NodeImpl implements Node { public void start(String contributionURI, String compositeURI) throws ActivationException, ValidationException, ContributionReadException { InstalledContribution ic = locallyInstalledContributions.get(contributionURI); if (ic == null) { - String url = endpointRegistry.getInstalledContributionURL(contributionURI); + + org.apache.tuscany.sca.runtime.InstalledContribution icx = endpointRegistry.getInstalledContribution(contributionURI); + String url = null; + if (icx != null) { + url = icx.getURL(); + } if (url == null) { throw new IllegalArgumentException("Contribution not installed: " + contributionURI); } @@ -237,8 +245,11 @@ public class NodeImpl implements Node { domainComposite.setAutowire(false); domainComposite.setLocal(false); List<Composite> domainIncludes = domainComposite.getIncludes(); - for (QName compositeName : endpointRegistry.getRunningCompositeNames()) { - domainIncludes.add(endpointRegistry.getRunningComposite(compositeName)); + Map<String, List<QName>> runningComposites = endpointRegistry.getRunningCompositeNames(); + for (String curi : runningComposites.keySet()) { + for (QName name : runningComposites.get(curi)) { + domainIncludes.add(endpointRegistry.getRunningComposite(curi, name)); + } } return domainComposite; } |