From f47f6707497e8645da513d6abbe9fe280e0b7fe2 Mon Sep 17 00:00:00 2001 From: jsdelfino Date: Thu, 31 Jul 2008 01:27:51 +0000 Subject: Node launcher gets IOException from System.in and fails when started as a detached daemon on Linux. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@681252 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/tuscany/sca/node/launcher/DomainManagerLauncher.java | 9 ++++++++- .../org/apache/tuscany/sca/node/launcher/NodeDaemonLauncher.java | 9 ++++++++- .../java/org/apache/tuscany/sca/node/launcher/NodeLauncher.java | 9 ++++++++- 3 files changed, 24 insertions(+), 3 deletions(-) (limited to 'java/sca/modules') diff --git a/java/sca/modules/node2-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/DomainManagerLauncher.java b/java/sca/modules/node2-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/DomainManagerLauncher.java index fa199bfa45..e962491b25 100644 --- a/java/sca/modules/node2-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/DomainManagerLauncher.java +++ b/java/sca/modules/node2-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/DomainManagerLauncher.java @@ -90,7 +90,14 @@ public class DomainManagerLauncher { logger.info("Press enter to shutdown."); try { System.in.read(); - } catch (IOException e) {} + } catch (IOException e) { + + // Wait forever + Object lock = new Object(); + synchronized(lock) { + lock.wait(); + } + } // Stop the domain manager try { diff --git a/java/sca/modules/node2-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeDaemonLauncher.java b/java/sca/modules/node2-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeDaemonLauncher.java index 64af0b8849..2756bf2073 100644 --- a/java/sca/modules/node2-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeDaemonLauncher.java +++ b/java/sca/modules/node2-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeDaemonLauncher.java @@ -79,7 +79,14 @@ public class NodeDaemonLauncher { logger.info("Press enter to shutdown."); try { System.in.read(); - } catch (IOException e) {} + } catch (IOException e) { + + // Wait forever + Object lock = new Object(); + synchronized(lock) { + lock.wait(); + } + } // Stop the node daemon try { diff --git a/java/sca/modules/node2-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeLauncher.java b/java/sca/modules/node2-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeLauncher.java index 1c19ac0c08..44a5430976 100644 --- a/java/sca/modules/node2-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeLauncher.java +++ b/java/sca/modules/node2-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeLauncher.java @@ -129,7 +129,14 @@ public class NodeLauncher { logger.info("Press enter to shutdown."); try { System.in.read(); - } catch (IOException e) {} + } catch (IOException e) { + + // Wait forever + Object lock = new Object(); + synchronized(lock) { + lock.wait(); + } + } // Stop the node try { -- cgit v1.2.3