summaryrefslogtreecommitdiffstats
path: root/branches/sca-equinox/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncher.java
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
1 files changed, 6 insertions, 5 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
}