diff options
author | Jan Bartel | 2012-11-06 03:35:37 +0000 |
---|---|---|
committer | Jan Bartel | 2012-11-06 03:35:37 +0000 |
commit | fe09ca0e66497755f6f7a29079d59cda3a3086f5 (patch) | |
tree | b629ded38e0d1193a82441121848e0838c332819 | |
parent | 26b4f69a02613928d8b01d68676af4a61566cb8e (diff) | |
download | org.eclipse.jetty.project-fe09ca0e66497755f6f7a29079d59cda3a3086f5.tar.gz org.eclipse.jetty.project-fe09ca0e66497755f6f7a29079d59cda3a3086f5.tar.xz org.eclipse.jetty.project-fe09ca0e66497755f6f7a29079d59cda3a3086f5.zip |
391623 Add option to --stop to wait for target jetty to stop
-rw-r--r-- | jetty-start/src/main/java/org/eclipse/jetty/start/Main.java | 20 | ||||
-rw-r--r-- | jetty-start/src/main/resources/org/eclipse/jetty/start/usage.txt | 5 |
2 files changed, 7 insertions, 18 deletions
diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/Main.java b/jetty-start/src/main/java/org/eclipse/jetty/start/Main.java index 3aa0483d23..8323e53852 100644 --- a/jetty-start/src/main/java/org/eclipse/jetty/start/Main.java +++ b/jetty-start/src/main/java/org/eclipse/jetty/start/Main.java @@ -179,21 +179,13 @@ public class Main _showUsage = true; continue; } - - if ("--stop".equals(arg)) - { - int port = Integer.parseInt(Config.getProperty("STOP.PORT","-1")); - String key = Config.getProperty("STOP.KEY",null); - stop(port,key); - return null; - } - if ("--stop-wait".equals(arg)) + if ("--stop".equals(arg)) { int port = Integer.parseInt(Config.getProperty("STOP.PORT","-1")); String key = Config.getProperty("STOP.KEY",null); int timeout = Integer.parseInt(Config.getProperty("STOP.WAIT", "0")); - stop(port,key, true, timeout); + stop(port,key,timeout); return null; } @@ -1015,11 +1007,11 @@ public class Main */ public void stop(int port, String key) { - stop (port,key,false, 0); + stop (port,key, 0); } - public void stop (int port, String key, boolean wait, int timeout) + public void stop (int port, String key, int timeout) { int _port = port; String _key = key; @@ -1038,7 +1030,7 @@ public class Main } Socket s = new Socket(InetAddress.getByName("127.0.0.1"),_port); - if (wait && timeout > 0) + if (timeout > 0) s.setSoTimeout(timeout*1000); try { @@ -1046,7 +1038,7 @@ public class Main out.write((_key + "\r\nstop\r\n").getBytes()); out.flush(); - if (wait) + if (timeout > 0) { System.err.println("Waiting"+(timeout > 0 ? (" "+timeout+"sec") : "")+" for jetty to stop"); LineNumberReader lin = new LineNumberReader(new InputStreamReader(s.getInputStream())); diff --git a/jetty-start/src/main/resources/org/eclipse/jetty/start/usage.txt b/jetty-start/src/main/resources/org/eclipse/jetty/start/usage.txt index 54c32d45ce..5af648a37c 100644 --- a/jetty-start/src/main/resources/org/eclipse/jetty/start/usage.txt +++ b/jetty-start/src/main/resources/org/eclipse/jetty/start/usage.txt @@ -26,9 +26,6 @@ Command Line Options: --stop Send a stop signal to the running Jetty instance. - --stop-wait Send a stop signal to the running Jetty instance, waiting for - confirmation that it is stopping. - --daemon Start in daemon mode with stderr and stdout redirected to ${jetty.log}/start.log @@ -99,7 +96,7 @@ Properties: STOP.WAIT=[number] The time (in seconds) to wait for confirmation that the running Jetty server has stopped. If not specified, the stopper will wait indefinitely. Use in - conjunction with the --stop-wait option. + conjunction with the --stop option. DEBUG=true Enable debug on the start mechanism and sets the |