diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2011-06-27 09:17:09 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2011-06-27 09:17:09 +0000 |
commit | a1e074f42d8f041888b952c6b9ab2d5bdf3b50f3 (patch) | |
tree | 16ac39ac70ee7ac42fcfc9fca9dd1c6c73dff0be /sca-java-2.x/trunk | |
parent | a46ba8d3bfc7e7cacf0a340c589f7598ab5cdabc (diff) |
Make DeployedComposite set the Contribution ClassLoader when a composite is started. It feels like there should be a better place for this to be happening, perhaps in the builder somewhere but for now this ensures that a composite's contribution will have a classloader set after the a composite is started.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1140065 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk')
-rw-r--r-- | sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/DeployedComposite.java | 6 |
1 files changed, 6 insertions, 0 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 e9fa5655ab..871c2fef06 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 @@ -34,6 +34,8 @@ import org.apache.tuscany.sca.assembly.impl.CompositeImpl; import org.apache.tuscany.sca.context.CompositeContext; import org.apache.tuscany.sca.contribution.Contribution; import org.apache.tuscany.sca.contribution.processor.ContributionResolveException; +import org.apache.tuscany.sca.contribution.resolver.ClassReference; +import org.apache.tuscany.sca.contribution.resolver.ExtensibleModelResolver; import org.apache.tuscany.sca.core.ExtensionPointRegistry; import org.apache.tuscany.sca.deployment.Deployer; import org.apache.tuscany.sca.monitor.Monitor; @@ -103,6 +105,10 @@ public class DeployedComposite { builtComposite.setName(composite.getName()); builtComposite.setURI(composite.getURI()); builtComposite.setContributionURI(composite.getContributionURI()); + + if (contribution.getClassLoader() == null) { + contribution.setClassLoader((ClassLoader)((ExtensibleModelResolver)contribution.getModelResolver()).getModelResolverInstance(ClassReference.class)); + } compositeContext = new CompositeContext(extensionPointRegistry, domainRegistry, |