Author: rob.stryker(a)jboss.com
Date: 2009-01-14 06:08:47 -0500 (Wed, 14 Jan 2009)
New Revision: 13033
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/StopLaunchConfiguration.java
Log:
JBIDE-3461 - weird cpu usage spike
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/StopLaunchConfiguration.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/StopLaunchConfiguration.java 2009-01-14
08:06:13 UTC (rev 13032)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/StopLaunchConfiguration.java 2009-01-14
11:08:47 UTC (rev 13033)
@@ -43,6 +43,7 @@
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
+import org.jboss.ide.eclipse.as.core.server.internal.JBossServerBehavior;
public class StopLaunchConfiguration extends AbstractJBossLaunchConfigType {
@@ -57,7 +58,11 @@
ILaunchConfigurationWorkingCopy wc = createLaunchConfiguration(server);
ILaunch launch = wc.launch(ILaunchManager.RUN_MODE, new NullProgressMonitor());
IProcess stopProcess = launch.getProcesses()[0];
- while( !stopProcess.isTerminated()) {}
+ while( !stopProcess.isTerminated() && server.getServerState() ==
IServer.STATE_STOPPING) {}
+ if( !stopProcess.isTerminated()) {
+ stopProcess.terminate();
+ return false;
+ }
return stopProcess.getExitValue() == 0 ? true : false;
} catch( CoreException ce ) {
// report it from here
Show replies by date