diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2011-05-13 08:35:15 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2011-05-13 08:35:15 +0000 |
commit | 6dc5802b6c00157a8f3d3dd470c700ebcf7712b3 (patch) | |
tree | 22aa7a7595476b4d57d44a645e9779c95e61f545 /sca-java-2.x/trunk/modules/domain-node/src/main | |
parent | a8bf783d679577a3bfdf14e09dc9251c4ee258a5 (diff) |
Add code to find the contribution attributes when installing a contribution
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1102609 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/domain-node/src/main')
-rw-r--r-- | sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java | 26 |
1 files changed, 26 insertions, 0 deletions
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 41f6bc9f1a..6688a9f2d6 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,14 +108,40 @@ public class NodeImpl implements Node { org.apache.tuscany.sca.runtime.InstalledContribution ic = new org.apache.tuscany.sca.runtime.InstalledContribution(); ic.setURI(uri); ic.setURL(contributionURL); + peekIntoContribution(ic); endpointRegistry.installContribution(ic); if (startDeployables) { + for (String compositeURI : ic.getDeployables()) { + start(uri, compositeURI); + } // TODO: sort out metadata and dependents in distributed localInstall(uri, contributionURL, metaDataURL, dependentContributionURIs, startDeployables); } return uri; } + /** + * ASM12032 and ASM12033 say no error checking should be done during install and that should happen later, but + * we would still like to know about deployables and exports so peek into the contribution to try to get those, + * and just ignore any errors they might happen while doing that. + */ + protected void peekIntoContribution(org.apache.tuscany.sca.runtime.InstalledContribution ic) { + Contribution contribution = null; + try { + contribution = deployer.loadContribution(IOHelper.createURI(ic.getURI()), IOHelper.getLocationAsURL(ic.getURI()), deployer.createMonitor()); + } catch (Exception e) { + // ignore any errors + } + if (contribution != null) { + for (Composite composite : contribution.getDeployables()) { + ic.getDeployables().add(composite.getURI()); + } + // TODO: need to sort out if Export or xml goes in the reg +// for (Export e : contribution.getExports()) { +// } + } + } + private void localInstall(String uri, String contributionURL, String metaDataURL, List<String> dependentContributionURIs, boolean startDeployables) throws ContributionReadException, ValidationException, ActivationException { Monitor monitor = deployer.createMonitor(); Contribution contribution = deployer.loadContribution(IOHelper.createURI(uri), IOHelper.getLocationAsURL(contributionURL), monitor); |