diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2012-03-04 21:14:26 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2012-03-04 21:14:26 +0000 |
commit | 94c82a74def0f1d229e6b31e3b6a2c732f70b273 (patch) | |
tree | ae19a1e37692b22443c2c44758acf89b740c90ba | |
parent | 553a373be707a466b2fdac6eb10568572b6f10a1 (diff) |
Fix Deployer.resolve to resolve dependent contributions correctly. It looks like nothing is using Deplyer.resolve except the validateContribution call so this bug had gone unoticed, the code in Deplyer.resove is duplicate din build, really build should just call resolve, i'll do that change in a seperate commit
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1296876 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
3 files changed, 11 insertions, 7 deletions
diff --git a/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/Deployer.java b/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/Deployer.java index f2af30b145..0e6b297b7b 100644 --- a/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/Deployer.java +++ b/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/Deployer.java @@ -218,7 +218,7 @@ public interface Deployer extends LifeCycleListener { * @throws ContributionResolveException * @throws CompositeBuilderException */ - void resolve(Contribution c, List<Contribution> dependentContributions, Monitor monitor) throws ContributionResolveException, CompositeBuilderException; + void resolve(List<Contribution> contributionList, Contribution systemContribution, Monitor monitor) throws ContributionResolveException, CompositeBuilderException; public Contribution cloneSystemContribution(Monitor monitor); diff --git a/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java b/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java index ae9a869417..57bd6507d9 100644 --- a/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java +++ b/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java @@ -610,12 +610,12 @@ public class DeployerImpl implements Deployer { return domainComposite; } - public void resolve(Contribution c, List<Contribution> dependentContributions, Monitor monitor) throws ContributionResolveException, CompositeBuilderException { + public void resolve(List<Contribution> contributionList, Contribution systemContribution, Monitor monitor) throws ContributionResolveException, CompositeBuilderException { init(); - List<Contribution> contributionList = new ArrayList<Contribution>(); - contributionList.add(c); - Contribution systemContribution = cloneSystemContribution(monitor); + if (systemContribution == null) { + systemContribution = cloneSystemContribution(monitor); + } Definitions systemDefinitions = systemContribution.getArtifacts().get(0).getModel(); // Build an aggregated SCA definitions model. Must be done before we try and // resolve any contributions or composites as they may depend on the full @@ -635,6 +635,7 @@ public class DeployerImpl implements Deployer { continue; } Object model = artifact.getModel(); + // FIXME: Should we check the artifact URI is META-INF/definitions.xml? if (model instanceof Definitions) { try { monitor.pushContext("Definitions: " + artifact.getLocation()); @@ -671,7 +672,7 @@ public class DeployerImpl implements Deployer { Set<Contribution> resolved = new HashSet<Contribution>(); for (Contribution contribution : contributionList) { - buildDependencies(contribution, dependentContributions, monitor); + buildDependencies(contribution, contributionList, monitor); // Resolve contributions for (Contribution dependency : contribution.getDependencies()) { 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 9ee36c1e38..456c4ef7b6 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 @@ -344,7 +344,10 @@ public class NodeImpl implements Node { Monitor monitor = deployer.createMonitor(); try { - deployer.resolve(contribution, calculateDependentContributions(cd), monitor); + ArrayList<Contribution> cs = new ArrayList<Contribution>(); + cs.add(contribution); + cs.addAll(calculateDependentContributions(cd)); + deployer.resolve(cs, null, monitor); } catch (Exception e) { loadedContributions.remove(cd.getURI()); throw new RuntimeException(e); |