diff options
6 files changed, 23 insertions, 15 deletions
diff --git a/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/node2/Node.java b/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/node2/Node.java index 5f4e4d3017..9cf0e90d7d 100644 --- a/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/node2/Node.java +++ b/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/node2/Node.java @@ -72,8 +72,9 @@ public interface Node { String installContribution(Contribution contribution, List<String> dependentContributionURIs, boolean runDeployables) throws ContributionReadException, ActivationException, ValidationException; /** - * Creates an installed contribution from a supplied root contribution. - * See section 10.5.1 of the Assembly Specification. + * Creates an installed contribution from a supplied root contribution URL. + * See section 10.5.1 of the Assembly Specification. This version of + * installContribution automatically runs deployable composites * * @param contributionURL the URL where the contribution is located * @return the URI of the installed contribution @@ -244,7 +245,7 @@ public interface Node { * @param contributionURI the contribution URI * @return the List of deployed composites */ - List<String> getDeployedCompostes(String contributionURI); + List<String> getDeployedComposites(String contributionURI); /** * Get the URIs of all the contributions installed on this Node diff --git a/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/node2/NodeFactory.java b/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/node2/NodeFactory.java index 153a5341cd..c01befef5d 100644 --- a/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/node2/NodeFactory.java +++ b/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/node2/NodeFactory.java @@ -86,9 +86,16 @@ public class NodeFactory { protected NodeFactory(Properties config) { init(config); } + + public Node createNode() { + return createNode(null); + } public Node createNode(String domainURI) { - String domainName = getDomainName(domainURI); + String domainName = "default"; + if (domainURI != null){ + domainName = getDomainName(domainURI); + } EndpointRegistry endpointRegistry = domainRegistryFactory.getEndpointRegistry(domainURI, domainName); return new NodeImpl(domainName, deployer, compositeActivator, endpointRegistry, extensionPointRegistry, null); } 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 19159e96b8..f2dc3bccb0 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 @@ -270,7 +270,7 @@ public class NodeImpl implements Node { return domainName; } - public List<String> getDeployedCompostes(String contributionURI) { + public List<String> getDeployedComposites(String contributionURI) { ArrayList<String> compositeURIs = new ArrayList<String>(); InstalledContribution ic = installedContributions.get(contributionURI); if (ic == null) { diff --git a/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/node2/DeployerTestCase.java b/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/node2/DeployerTestCase.java index 450e5a8b3e..4d0d4abfd2 100644 --- a/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/node2/DeployerTestCase.java +++ b/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/node2/DeployerTestCase.java @@ -69,7 +69,7 @@ public class DeployerTestCase { monitor.analyzeProblems(); composite.setURI("helloworld2.composite"); node.addDeploymentComposite("foo", composite); - List<String> dcs = node.getDeployedCompostes("foo"); + List<String> dcs = node.getDeployedComposites("foo"); Assert.assertEquals(1, dcs.size()); Assert.assertEquals("helloworld2.composite", dcs.get(0)); } diff --git a/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/node2/NodeTestCase.java b/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/node2/NodeTestCase.java index 0792a25454..cdf8b02688 100644 --- a/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/node2/NodeTestCase.java +++ b/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/node2/NodeTestCase.java @@ -85,7 +85,7 @@ public class NodeTestCase { public void testGetDeployedCompostes() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, MalformedURLException, ActivationException, ValidationException { Node node = NodeFactory.newInstance().createNode("default"); node.installContribution("foo", "src/test/resources/sample-helloworld.jar", null, null, true); - List<String> dcs = node.getDeployedCompostes("foo"); + List<String> dcs = node.getDeployedComposites("foo"); Assert.assertEquals(1, dcs.size()); Assert.assertEquals("helloworld.composite", dcs.get(0)); } @@ -95,7 +95,7 @@ public class NodeTestCase { Node node = NodeFactory.newInstance().createNode("default"); node.installContribution("foo", "src/test/resources/sample-helloworld.jar", null, null, true); node.removeFromDomainLevelComposite("foo", "helloworld.composite"); - List<String> dcs = node.getDeployedCompostes("foo"); + List<String> dcs = node.getDeployedComposites("foo"); Assert.assertEquals(0, dcs.size()); } @@ -104,7 +104,7 @@ public class NodeTestCase { Node node = NodeFactory.newInstance().createNode("default"); ((NodeImpl)node).installContribution("helloworld", "src/test/resources/sample-helloworld-nodeployable.jar", "src/test/resources/sca-contribution-generated.xml", null, true); - List<String> dcs = node.getDeployedCompostes("helloworld"); + List<String> dcs = node.getDeployedComposites("helloworld"); Assert.assertEquals(1, dcs.size()); Assert.assertEquals("helloworld.composite", dcs.get(0)); @@ -124,7 +124,7 @@ public class NodeTestCase { Node node = NodeFactory.newStandaloneNode("helloworld.composite", "src/test/resources/sample-helloworld.jar"); List<String> cs = node.getInstalledContributions(); Assert.assertEquals(1, cs.size()); - List<String> dcs = node.getDeployedCompostes(cs.get(0)); + List<String> dcs = node.getDeployedComposites(cs.get(0)); Assert.assertEquals(1, dcs.size()); Assert.assertEquals("helloworld.composite", dcs.get(0)); } @@ -134,7 +134,7 @@ public class NodeTestCase { Node node = NodeFactory.newStandaloneNode(null, "src/test/resources/sample-helloworld.jar"); List<String> cs = node.getInstalledContributions(); Assert.assertEquals(1, cs.size()); - List<String> dcs = node.getDeployedCompostes(cs.get(0)); + List<String> dcs = node.getDeployedComposites(cs.get(0)); Assert.assertEquals(1, dcs.size()); Assert.assertEquals("helloworld.composite", dcs.get(0)); } diff --git a/sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/Shell.java b/sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/Shell.java index ef7ca06a1a..59e98d2c84 100644 --- a/sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/Shell.java +++ b/sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/Shell.java @@ -224,7 +224,7 @@ public class Shell { currentDomain = "";
}
} else {
- for (String compositeURI : getNode().getDeployedCompostes(curi)) {
+ for (String compositeURI : getNode().getDeployedComposites(curi)) {
getNode().removeFromDomainLevelComposite(curi, compositeURI);
}
}
@@ -277,7 +277,7 @@ public class Shell { for (String nodeName : standaloneNodes.keySet()) {
Node node = standaloneNodes.get(nodeName);
for (String curi : node.getInstalledContributions()) {
- for (String dc : node.getDeployedCompostes(curi)) {
+ for (String dc : node.getDeployedComposites(curi)) {
out.println(" " + nodeName + " " + dc);
}
}
@@ -297,12 +297,12 @@ public class Shell { for (String curi : ics) {
Contribution c = node.getInstalledContribution(curi);
- List<String> dcs = node.getDeployedCompostes(curi);
+ List<String> dcs = node.getDeployedComposites(curi);
if (toks.size() > 2) {
dcs = new ArrayList<String>();
dcs.add(toks.get(2));
} else {
- dcs = node.getDeployedCompostes(curi);
+ dcs = node.getDeployedComposites(curi);
}
for (String compositeUri : dcs) {
for (Artifact a : c.getArtifacts()) {
|