You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by rm...@apache.org on 2012/01/12 11:58:42 UTC

svn commit: r1230483 - in /openejb/trunk/maven-plugins/tomee-maven-plugin/src/main/java/org/apache/openejb/maven/plugin: AbstractTomEEMojo.java ConfigTestTomEEMojo.java

Author: rmannibucau
Date: Thu Jan 12 10:58:42 2012
New Revision: 1230483

URL: http://svn.apache.org/viewvc?rev=1230483&view=rev
Log:
fixing await or not state for tomee plugin

Modified:
    openejb/trunk/maven-plugins/tomee-maven-plugin/src/main/java/org/apache/openejb/maven/plugin/AbstractTomEEMojo.java
    openejb/trunk/maven-plugins/tomee-maven-plugin/src/main/java/org/apache/openejb/maven/plugin/ConfigTestTomEEMojo.java

Modified: openejb/trunk/maven-plugins/tomee-maven-plugin/src/main/java/org/apache/openejb/maven/plugin/AbstractTomEEMojo.java
URL: http://svn.apache.org/viewvc/openejb/trunk/maven-plugins/tomee-maven-plugin/src/main/java/org/apache/openejb/maven/plugin/AbstractTomEEMojo.java?rev=1230483&r1=1230482&r2=1230483&view=diff
==============================================================================
--- openejb/trunk/maven-plugins/tomee-maven-plugin/src/main/java/org/apache/openejb/maven/plugin/AbstractTomEEMojo.java (original)
+++ openejb/trunk/maven-plugins/tomee-maven-plugin/src/main/java/org/apache/openejb/maven/plugin/AbstractTomEEMojo.java Thu Jan 12 10:58:42 2012
@@ -41,7 +41,6 @@ import java.util.Arrays;
 import java.util.Enumeration;
 import java.util.List;
 import java.util.Map;
-import java.util.concurrent.CountDownLatch;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipFile;
 
@@ -348,13 +347,11 @@ public abstract class AbstractTomEEMojo 
             strings.add("-Dtomee.noshutdownhook=true");
         }
 
-        final RemoteServer server = new RemoteServer(Integer.MAX_VALUE, false);
-        final CountDownLatch latch = new CountDownLatch(1);
+        final RemoteServer server = new RemoteServer(getConnectAttempts(), false);
         if (!getNoShutdownHook()) {
             Runtime.getRuntime().addShutdownHook(new Thread() {
                 @Override public void run() {
                     server.stop();
-                    latch.countDown();
                 }
             });
         }
@@ -363,13 +360,17 @@ public abstract class AbstractTomEEMojo 
 
         if (!getNoShutdownHook()) {
             try {
-                latch.await();
+                server.getServer().waitFor(); // connect attempts = 0
             } catch (InterruptedException e) {
                 // ignored
             }
         }
     }
 
+    protected  int getConnectAttempts() {
+        return Integer.MAX_VALUE;
+    }
+
     protected static String java() {
         return new File(System.getProperty("java.home"), "/bin/java").getAbsolutePath();
     }

Modified: openejb/trunk/maven-plugins/tomee-maven-plugin/src/main/java/org/apache/openejb/maven/plugin/ConfigTestTomEEMojo.java
URL: http://svn.apache.org/viewvc/openejb/trunk/maven-plugins/tomee-maven-plugin/src/main/java/org/apache/openejb/maven/plugin/ConfigTestTomEEMojo.java?rev=1230483&r1=1230482&r2=1230483&view=diff
==============================================================================
--- openejb/trunk/maven-plugins/tomee-maven-plugin/src/main/java/org/apache/openejb/maven/plugin/ConfigTestTomEEMojo.java (original)
+++ openejb/trunk/maven-plugins/tomee-maven-plugin/src/main/java/org/apache/openejb/maven/plugin/ConfigTestTomEEMojo.java Thu Jan 12 10:58:42 2012
@@ -26,4 +26,9 @@ public class ConfigTestTomEEMojo extends
     public String getCmd() {
         return "configtest";
     }
+
+    @Override
+    protected int getConnectAttempts() {
+        return 0;
+    }
 }