summaryrefslogtreecommitdiffstats
path: root/branches/sca-equinox/modules/node-launcher-equinox
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--branches/sca-equinox/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncher.java11
-rw-r--r--branches/sca-equinox/modules/node-launcher-equinox/src/test/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherTestCase.java4
2 files changed, 8 insertions, 7 deletions
diff --git a/branches/sca-equinox/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncher.java b/branches/sca-equinox/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncher.java
index 614c34b01e..68d1fa05e7 100644
--- a/branches/sca-equinox/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncher.java
+++ b/branches/sca-equinox/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncher.java
@@ -64,7 +64,7 @@ public class NodeLauncher {
* @return a new SCA node.
* @throws LauncherException
*/
- public <T> T createNodeFromURL(String configurationURL) throws LauncherException {
+ public <T> T createNode(String configurationURL) throws LauncherException {
return (T)node(configurationURL, null, null, null, bundleContext);
}
@@ -113,7 +113,7 @@ public class NodeLauncher {
// Create a node from a configuration URI
String configurationURI = args[0];
logger.info("SCA Node configuration: " + configurationURI);
- node = launcher.createNodeFromURL(configurationURI);
+ node = launcher.createNode(configurationURI);
} else {
// Create a node from a composite URI and a contribution location
@@ -157,7 +157,7 @@ public class NodeLauncher {
// Stop the node
if (node != null) {
- stopNode(node);
+ destroyNode(node);
}
if (equinox != null) {
equinox.stop();
@@ -178,9 +178,10 @@ public class NodeLauncher {
* @param node
* @throws Exception
*/
- private static void stopNode(Object node) throws Exception {
+ private static void destroyNode(Object node) throws Exception {
try {
node.getClass().getMethod("stop").invoke(node);
+ node.getClass().getMethod("destroy").invoke(node);
logger.info("SCA Node is now stopped.");
} catch (Exception e) {
logger.log(Level.SEVERE, "SCA Node could not be stopped", e);
@@ -200,7 +201,7 @@ public class NodeLauncher {
public void run() {
try {
- stopNode(node);
+ destroyNode(node);
} catch (Exception e) {
// Ignore
}
diff --git a/branches/sca-equinox/modules/node-launcher-equinox/src/test/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherTestCase.java b/branches/sca-equinox/modules/node-launcher-equinox/src/test/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherTestCase.java
index b109b690c5..6186b1799a 100644
--- a/branches/sca-equinox/modules/node-launcher-equinox/src/test/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherTestCase.java
+++ b/branches/sca-equinox/modules/node-launcher-equinox/src/test/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherTestCase.java
@@ -19,7 +19,7 @@
package org.apache.tuscany.sca.node.equinox.launcher;
-import org.apache.tuscany.sca.node.SCANode;
+import org.apache.tuscany.sca.node.Node;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Ignore;
@@ -51,7 +51,7 @@ public class NodeLauncherTestCase {
@Test
public void testLaunch() throws Exception {
String location = ContributionLocationHelper.getContributionLocation(getClass());
- SCANode node = launcher.createNode("HelloWorld.composite", new Contribution("test", location));
+ Node node = launcher.createNode("HelloWorld.composite", new Contribution("test", location));
node.start();
node.stop();
}