Author: koen.aers(a)jboss.com
Date: 2011-09-15 04:12:13 -0400 (Thu, 15 Sep 2011)
New Revision: 34752
Modified:
trunk/forge/plugins/org.jboss.tools.forge.core/src/org/jboss/tools/forge/core/process/ForgeAbstractRuntime.java
Log:
make sure the tools don't have to wait forever on a response from the runtime when
sending a command
Modified:
trunk/forge/plugins/org.jboss.tools.forge.core/src/org/jboss/tools/forge/core/process/ForgeAbstractRuntime.java
===================================================================
---
trunk/forge/plugins/org.jboss.tools.forge.core/src/org/jboss/tools/forge/core/process/ForgeAbstractRuntime.java 2011-09-15
06:49:19 UTC (rev 34751)
+++
trunk/forge/plugins/org.jboss.tools.forge.core/src/org/jboss/tools/forge/core/process/ForgeAbstractRuntime.java 2011-09-15
08:12:13 UTC (rev 34752)
@@ -103,11 +103,12 @@
ForgeCorePlugin.log(e);
}
try {
- while (commandResultListener.result == null) {
+ int count = 0; // give up after 5 seconds
+ while (commandResultListener.result == null && count++ < 50) {
Thread.sleep(100);
}
} catch (InterruptedException e) {}
- result = commandResultListener.result;
+ result = commandResultListener.result == null ? "" :
commandResultListener.result;
commandResultListener.result = null;
commandResultListener.command = null;
streamMonitor.removeListener(commandResultListener);
@@ -204,6 +205,7 @@
String command = null;
@Override
public void streamAppended(String text, IStreamMonitor monitor) {
+ System.out.println("streamAppended: " + text);
outputAvailable(text);
}
@Override
Show replies by date