Author: veithen
Date: Fri Aug 15 15:00:31 2008
New Revision: 686387

URL: http://svn.apache.org/viewvc?rev=686387&view=rev
Log:
SYNAPSE-425: SynapseServer: Put the main thread into wait state. This makes 
sure that Synapse doesn't stop immediately if ServerManager#start doesn't 
create any non daemon threads.

Modified:
    
synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/SynapseServer.java

Modified: 
synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/SynapseServer.java
URL: 
http://svn.apache.org/viewvc/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/SynapseServer.java?rev=686387&r1=686386&r2=686387&view=diff
==============================================================================
--- 
synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/SynapseServer.java
 (original)
+++ 
synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/SynapseServer.java
 Fri Aug 15 15:00:31 2008
@@ -24,6 +24,7 @@
 import org.apache.commons.logging.LogFactory;
 
 import java.io.File;
+import java.util.concurrent.CountDownLatch;
 
 /**
  * This is the class invoked by the command line scripts synapse.sh and 
synapse-daemon.sh to
@@ -80,6 +81,11 @@
         
         serverManager.start();
         addShutdownHook();
+        
+        // Put the main thread into wait state. This makes sure that the 
Synapse server
+        // doesn't stop immediately if ServerManager#start doesn't create any 
non daemon
+        // threads (see also SYNAPSE-425).
+        new CountDownLatch(1).await();
     }
 
     private static void addShutdownHook() {


Reply via email to