geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dwo...@apache.org
Subject svn commit: r560256 - /geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/GeronimoServerBehaviourDelegate.java
Date Fri, 27 Jul 2007 14:53:30 GMT
Author: dwoods
Date: Fri Jul 27 07:53:29 2007
New Revision: 560256

URL: http://svn.apache.org/viewvc?view=rev&rev=560256
Log:
GERONIMODEVTOOLS-178 Deadlock while stopping Geronimo server from within Eclipse.  Patch from
Shiva.

Modified:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/GeronimoServerBehaviourDelegate.java

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/GeronimoServerBehaviourDelegate.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/GeronimoServerBehaviourDelegate.java?view=diff&rev=560256&r1=560255&r2=560256
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/GeronimoServerBehaviourDelegate.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/GeronimoServerBehaviourDelegate.java
Fri Jul 27 07:53:29 2007
@@ -168,26 +168,30 @@
 	 * 
 	 * @see org.eclipse.wst.server.core.model.ServerBehaviourDelegate#stop(boolean)
 	 */
-	synchronized public void stop(boolean force) {
-		Trace.trace(Trace.INFO, "--> stop()");
-		stopPingThread();
-		if (getServer().getServerState() != IServer.STATE_STOPPED) {
-			setServerState(IServer.STATE_STOPPING);
-			stopKernel();
-		}
-		GeronimoConnectionFactory.getInstance().destroy(getServer());
-		if (force) {
-			terminate();
-			return;
-		}
-		int state = getServer().getServerState();
-		if (state == IServer.STATE_STOPPED)
-			return;
-		if (state == IServer.STATE_STARTING || state == IServer.STATE_STOPPING)
-			terminate();
-		Trace.trace(Trace.INFO, "<-- stop()");
-	}
-	
+    synchronized public void stop(final boolean force) {
+        new Thread() {
+            public void run() {
+                Trace.trace(Trace.INFO, "--> stop()");
+                stopPingThread();
+                if (getServer().getServerState() != IServer.STATE_STOPPED) {
+                    setServerState(IServer.STATE_STOPPING);
+                    stopKernel();
+                }
+                GeronimoConnectionFactory.getInstance().destroy(getServer());
+                if (force) {
+                    terminate();
+                    return;
+                }
+                int state = getServer().getServerState();
+                if (state == IServer.STATE_STOPPED)
+                    return;
+                if (state == IServer.STATE_STARTING || state == IServer.STATE_STOPPING)
+                    terminate();
+                Trace.trace(Trace.INFO, "<-- stop()");
+            }
+        }.start();
+    }
+
 	/* 
 	 * Override this method to be able to process in-place shared lib entries and restart the
shared lib configuration for all projects prior
 	 * to publishing each IModule.



Mime
View raw message