Author: rob.stryker(a)jboss.com
Date: 2011-05-10 11:33:05 -0400 (Tue, 10 May 2011)
New Revision: 31184
Modified:
workspace/rstryker/andre2/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ServerBehavior.java
Log:
two-server started error. Now both servers and processes terminate properly.
Modified:
workspace/rstryker/andre2/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ServerBehavior.java
===================================================================
---
workspace/rstryker/andre2/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ServerBehavior.java 2011-05-10
15:27:35 UTC (rev 31183)
+++
workspace/rstryker/andre2/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ServerBehavior.java 2011-05-10
15:33:05 UTC (rev 31184)
@@ -94,14 +94,14 @@
@Override
public void serverStarting() {
+ super.serverStarting();
pollServer(IServerStatePoller.SERVER_UP);
-// super.serverStarting();
}
@Override
public void serverStopping() {
+ super.serverStopping();
pollServer(IServerStatePoller.SERVER_DOWN);
-// super.serverStopping();
}
private void initDebugListener(IProcess process) {
@@ -160,20 +160,27 @@
}
public void stop(boolean force) {
+
try {
if (force) {
serverProcess.terminate();
} else {
+ serverStopping();
// TODO: for now only local, implement for remote afterwards
- if (isServerRunning("localhost")) { //$NON-NLS-1$
- getService().stop("localhost"); //$NON-NLS-1$
+ if (isServerRunning(getServer().getHost())) {
+ // The service and Poller will make sure the server is down
+ getService().stop(getServer().getHost());
+ return;
+ } else {
+ if( serverProcess != null && !serverProcess.isTerminated()) {
+ serverProcess.terminate();
+ }
}
}
- serverStopping();
- setServerStopped();
} catch (Exception e) {
e.printStackTrace();
}
+ setServerStopped();
}
@Override
@@ -202,7 +209,7 @@
public void handleDebugEvents(DebugEvent[] events) {
for (DebugEvent event : events) {
- if (serverProcess.equals(event.getSource())
+ if (serverProcess != null && serverProcess.equals(event.getSource())
&& event.getKind() == DebugEvent.TERMINATE) {
setServerStopped();
break;
Show replies by date