tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1293191 - /openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/RemoteServer.java
Date Fri, 24 Feb 2012 11:31:58 GMT
Author: rmannibucau
Date: Fri Feb 24 11:31:57 2012
New Revision: 1293191

URL: http://svn.apache.org/viewvc?rev=1293191&view=rev
Log:
trying to force window to not wait when running start command

Modified:
    openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/RemoteServer.java

Modified: openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/RemoteServer.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/RemoteServer.java?rev=1293191&r1=1293190&r2=1293191&view=diff
==============================================================================
--- openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/RemoteServer.java
(original)
+++ openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/RemoteServer.java
Fri Feb 24 11:31:57 2012
@@ -24,6 +24,7 @@ import java.io.File;
 import java.io.OutputStream;
 import java.net.Socket;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
@@ -123,7 +124,7 @@ public class RemoteServer {
                 } else {
                     lib = new File(new File(new File(home, "webapps"), "tomee"), "lib");
                 }
-                
+
                 for (File file : lib.listFiles()) {
                     if (file.getName().startsWith("openejb-core") && file.getName().endsWith("jar")){
                         openejbJar = file;
@@ -287,6 +288,16 @@ public class RemoteServer {
                 if (verbose) {
                     System.out.println(Join.join("\n", args));
                 }
+
+                final boolean isWindows = System.getProperty("os.name", "unknown").toLowerCase().startsWith("windows");
+                if (isWindows && "start".equals(cmd)) {
+                    // to fork
+                    final List<String> winList = new ArrayList<String>();
+                    winList.add("cmd");
+                    winList.add("/c");
+                    winList.addAll(Arrays.asList(args));
+                    args = winList.toArray(new String[winList.size()]);
+                }
                 server = Runtime.getRuntime().exec(args);
 
                 Pipe.pipe(server);



Mime
View raw message