Author: rob.stryker(a)jboss.com
Date: 2011-01-19 13:48:26 -0500 (Wed, 19 Jan 2011)
New Revision: 28404
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSELaunchDelegate.java
Log:
JBIDE-7753 - adds a 10 second delay as a quick fix for now.
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSELaunchDelegate.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSELaunchDelegate.java 2011-01-19
16:19:02 UTC (rev 28403)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSELaunchDelegate.java 2011-01-19
18:48:26 UTC (rev 28404)
@@ -35,6 +35,7 @@
import org.eclipse.rse.services.shells.IShellService;
import
org.eclipse.rse.subsystems.shells.core.subsystems.servicesubsystem.IShellServiceSubSystem;
import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.model.ServerBehaviourDelegate;
import org.jboss.ide.eclipse.as.core.extensions.polling.WebPortPoller;
import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
import org.jboss.ide.eclipse.as.core.server.internal.JBossServerBehavior;
@@ -86,14 +87,7 @@
try {
hs = service.runCommand("/", command, new String[]{}, new
NullProgressMonitor());
hs.addOutputListener(listener);
- int x = 0;
- while( x < 30000) {
- x+=1000;
- try {
- Thread.sleep(1000);
- } catch(InterruptedException ie) {
- }
- }
+ delay(30);
// Now launch ping thread
} catch(SystemMessageException sme) {
@@ -114,6 +108,18 @@
beh.setServerStarted();
}
+ private static void delay(int delay) {
+ int x = 1;
+ while( x < (delay)) {
+ x+=1;
+ try {
+ Thread.sleep(1000);
+ } catch(InterruptedException ie) {
+ }
+ }
+ }
+
+
public static void launchCommandNoResult(JBossServerBehavior behaviour, int delay,
String command) {
IShellService service = null;
try {
@@ -125,11 +131,7 @@
try {
final IHostShell hs = service.runCommand("/", command, new String[]{}, new
NullProgressMonitor());
if( hs != null ) {
- try {
- Thread.sleep(delay);
- } catch(InterruptedException ie) {
- // ignore
- }
+ delay(delay/1000);
}
} catch( SystemMessageException sme) {
// TODO
@@ -159,7 +161,7 @@
}
behaviour.setServerStopping();
-
+ final JBossServerBehavior behaviour2 = behaviour;
final String command = command2;
IShellService service = null;
try {
@@ -182,10 +184,10 @@
if( saving[0] ) {
output[0] = out[i].getString();
saving[0] = false;
- try {
- Thread.sleep(1000);
- } catch(InterruptedException ie) {}
+ delay(10);
+ behaviour2.setServerStopped();
hs.exit();
+ return;
}
/*
* This is an extreme hack, because for some reason,
@@ -202,7 +204,6 @@
}
});
- behaviour.setServerStopped();
} catch( SystemMessageException sme) {
// TODO
behaviour.setServerStarted(); // unable to stop the server
Show replies by date