diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2011-03-04 11:08:36 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2011-03-04 11:08:36 +0000 |
commit | d6eea782d80d232d177ac76e5f4b5eaaa1c59683 (patch) | |
tree | bdbc81ccdd874883fa59bad7ebfa38aa706615e9 /sca-java-2.x/trunk/modules/deployment | |
parent | 33cb5ad03d69152804bfbf27e9870dfe7cc6dde3 (diff) |
Update deployer to support passing in the system contribution so that that may be reused as cloning it each time can be slow
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1077875 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/deployment')
2 files changed, 14 insertions, 3 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 dba21e7197..e8750cf0ca 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 @@ -83,6 +83,9 @@ public interface Deployer extends LifeCycleListener { Composite build(List<Contribution> contributions, List<Contribution> allContributions, Map<QName, List<String>> bindingBaseURIs, Monitor monitor) throws ContributionResolveException, CompositeBuilderException; + Composite build(List<Contribution> contributions, List<Contribution> allContributions, Contribution systemContribution, Map<QName, List<String>> bindingBaseURIs, Monitor monitor) + throws ContributionResolveException, CompositeBuilderException; + /** * Load an artifact from the given location * @param uri @@ -204,4 +207,6 @@ public interface Deployer extends LifeCycleListener { * @throws CompositeBuilderException */ void resolve(Contribution c, List<Contribution> dependentContributions, 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 c3e680bd4d..8f3af59235 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 @@ -79,7 +79,6 @@ import org.apache.tuscany.sca.core.ExtensionPointRegistry; import org.apache.tuscany.sca.core.FactoryExtensionPoint; import org.apache.tuscany.sca.core.ModuleActivatorExtensionPoint; import org.apache.tuscany.sca.core.UtilityExtensionPoint; -import org.apache.tuscany.sca.core.assembly.impl.EndpointRegistryImpl; import org.apache.tuscany.sca.definitions.Definitions; import org.apache.tuscany.sca.definitions.DefinitionsFactory; import org.apache.tuscany.sca.definitions.util.DefinitionsUtil; @@ -374,7 +373,7 @@ public class DeployerImpl implements Deployer { } } - protected Contribution cloneSystemContribution(Monitor monitor) { + public Contribution cloneSystemContribution(Monitor monitor) { init(); Contribution contribution = contributionFactory.createContribution(); contribution.setURI(systemContribution.getURI()); @@ -472,10 +471,17 @@ public class DeployerImpl implements Deployer { public Composite build(List<Contribution> contributions, List<Contribution> allContributions, Map<QName, List<String>> bindingMap, Monitor monitor) throws ContributionResolveException, CompositeBuilderException { + return build(contributions, allContributions, null, bindingMap, monitor); + } + + public Composite build(List<Contribution> contributions, List<Contribution> allContributions, Contribution systemContribution, Map<QName, List<String>> bindingMap, Monitor monitor) + throws ContributionResolveException, CompositeBuilderException { init(); List<Contribution> contributionList = new ArrayList<Contribution>(contributions); - 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 |