diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2010-11-25 15:54:43 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2010-11-25 15:54:43 +0000 |
commit | be32381f21467ea121234b8196ec25f695170508 (patch) | |
tree | a6220e8d23717906853c189987d4622bb6bac0aa /sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/node2/impl | |
parent | 3a32bf8ca07814c64a60bb7699fa3fde165fc2ec (diff) |
Update node2 api to more closely match the commands the Shell has
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1039077 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/node2/impl')
-rw-r--r-- | sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/node2/impl/NodeImpl.java | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/node2/impl/NodeImpl.java b/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/node2/impl/NodeImpl.java index 459aa5e50c..7fe46764ed 100644 --- a/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/node2/impl/NodeImpl.java +++ b/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/node2/impl/NodeImpl.java @@ -74,7 +74,7 @@ public class NodeImpl implements Node { return installContribution(null, contributionURL, null, null, true); } - public String installContribution(String uri, String contributionURL, String metaDataURL, List<String> dependentContributionURIs, boolean runDeployables) throws ContributionReadException, ActivationException, ValidationException { + public String installContribution(String uri, String contributionURL, String metaDataURL, List<String> dependentContributionURIs, boolean startDeployables) throws ContributionReadException, ActivationException, ValidationException { if (uri == null) { uri = getDefaultContributionURI(contributionURL); } @@ -84,7 +84,7 @@ public class NodeImpl implements Node { if (metaDataURL != null) { mergeContributionMetaData(metaDataURL, contribution); } - installContribution(contribution, dependentContributionURIs, runDeployables); + installContribution(contribution, dependentContributionURIs, startDeployables); return uri; } @@ -102,12 +102,12 @@ public class NodeImpl implements Node { contribution.getExports().addAll(metaData.getExports()); } - public String installContribution(Contribution contribution, List<String> dependentContributionURIs, boolean runDeployables) throws ContributionReadException, ActivationException, ValidationException { + public String installContribution(Contribution contribution, List<String> dependentContributionURIs, boolean startDeployables) throws ContributionReadException, ActivationException, ValidationException { InstalledContribution ic = new InstalledContribution(contribution.getURI(), contribution.getLocation(), contribution, dependentContributionURIs); installedContributions.put(contribution.getURI(), ic); - if (runDeployables) { + if (startDeployables) { for (Composite c : ic.getDefaultDeployables()) { - runComposite(c, ic); + startComposite(c, ic); } } else { contribution.getDeployables().clear(); @@ -144,32 +144,31 @@ public class NodeImpl implements Node { return dependentContributions; } - public String addDeploymentComposite(String contributionURI, Reader compositeXML) throws ContributionReadException, XMLStreamException, ActivationException, ValidationException { + public String start(String contributionURI, Reader compositeXML) throws ContributionReadException, XMLStreamException, ActivationException, ValidationException { Monitor monitor = deployer.createMonitor(); Composite composite = deployer.loadXMLDocument(compositeXML, monitor); monitor.analyzeProblems(); - return addDeploymentComposite(contributionURI, composite); + return start(contributionURI, composite); } - public String addDeploymentComposite(String contributionURI, Composite composite) throws ActivationException, ValidationException { + public String start(String contributionURI, Composite composite) throws ActivationException, ValidationException { InstalledContribution ic = installedContributions.get(contributionURI); if (ic == null) { throw new IllegalArgumentException("contribution not installed: " + contributionURI); } String compositeArtifcatURI = deployer.attachDeploymentComposite(ic.getContribution(), composite, true); - runComposite(composite, ic); + startComposite(composite, ic); return compositeArtifcatURI; } - @Override - public void addToDomainLevelComposite(String contributionURI, String compositeURI) throws ActivationException, ValidationException { + public void start(String contributionURI, String compositeURI) throws ActivationException, ValidationException { InstalledContribution ic = installedContributions.get(contributionURI); if (ic == null) { throw new IllegalArgumentException("Contribution not installed: " + contributionURI); } for (Artifact a : ic.getContribution().getArtifacts()) { if (a.getURI().equals(compositeURI)) { - runComposite((Composite) a.getModel(), ic); + startComposite((Composite) a.getModel(), ic); return; } } @@ -177,7 +176,7 @@ public class NodeImpl implements Node { } @Override - public void removeFromDomainLevelComposite(String contributionURI, String compositeURI) throws ActivationException { + public void stop(String contributionURI, String compositeURI) throws ActivationException { InstalledContribution ic = installedContributions.get(contributionURI); if (ic == null) { throw new IllegalArgumentException("Contribution not installed: " + contributionURI); @@ -307,7 +306,7 @@ public class NodeImpl implements Node { return contributionURI; } - protected void runComposite(Composite c, InstalledContribution ic) throws ActivationException, ValidationException { + protected void startComposite(Composite c, InstalledContribution ic) throws ActivationException, ValidationException { List<Contribution> dependentContributions = calculateDependentContributions(ic); DeployedComposite dc = new DeployedComposite(c, ic, dependentContributions, deployer, compositeActivator, endpointRegistry, extensionPointRegistry); |