# HG changeset patch # User Jaroslav Tulach # Date 1255282368 -7200 # Node ID 4529cb22ff7de5a4374dcac4c7f477ef483f8caa # Parent e0ecef0c421bc4e560ca1d909dd68a4be8ff2204 Support for --kill mode in the webidor.jar diff -r e0ecef0c421b -r 4529cb22ff7d webidor/pom.xml --- a/webidor/pom.xml Sun Oct 11 19:19:09 2009 +0200 +++ b/webidor/pom.xml Sun Oct 11 19:32:48 2009 +0200 @@ -9,7 +9,7 @@ org.apidesign webidor jar - 1.5 + 1.6 webidor server http://maven.apache.org diff -r e0ecef0c421b -r 4529cb22ff7d webidor/src/main/java/cz/xelfi/quoridor/webidor/resources/Quoridor.java --- a/webidor/src/main/java/cz/xelfi/quoridor/webidor/resources/Quoridor.java Sun Oct 11 19:19:09 2009 +0200 +++ b/webidor/src/main/java/cz/xelfi/quoridor/webidor/resources/Quoridor.java Sun Oct 11 19:32:48 2009 +0200 @@ -120,7 +120,7 @@ // start the server // - public static void main(String[] args) throws IOException { + public static void main(String[] args) throws IOException, InterruptedException { int port = 9222; try { port = Integer.parseInt(args[0]); @@ -131,6 +131,14 @@ System.out.println( "Quoridor started at port " + port + "\n" + "Hit enter to stop it..." ); + if (args.length < 2 || !args[args.length - 1].equals("--kill")) { + System.out.println("Hit enter to stop it..."); + System.in.read(); + } else { + synchronized (Quoridor.class) { + Quoridor.class.wait(); + } + } System.in.read(); s.stop(0); System.exit(0);