diff options
Diffstat (limited to 'java/sca/modules/node-api/src')
-rw-r--r-- | java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeMain2.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeMain2.java b/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeMain2.java index 440b427c15..6c26db5a25 100644 --- a/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeMain2.java +++ b/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeMain2.java @@ -43,7 +43,13 @@ public class NodeMain2 { node.start();
System.out.println("Hit enter to stop node...");
- System.in.read();
+ if (System.in.read() == -1) {
+ // no sysin so wait for ever letting caller do the terminate
+ Object lock = new Object();
+ synchronized(lock) {
+ lock.wait();
+ }
+ }
node.stop();
}
|