freemarkerdor/src/main/java/cz/xelfi/quoridor/freemarkerdor/UI.java
branchstatistics-and-elo
changeset 180 c92831d4812c
parent 179 c5fbddc4c590
child 186 47e21a031490
     1.1 --- a/freemarkerdor/src/main/java/cz/xelfi/quoridor/freemarkerdor/UI.java	Thu Jan 07 22:51:17 2010 +0100
     1.2 +++ b/freemarkerdor/src/main/java/cz/xelfi/quoridor/freemarkerdor/UI.java	Thu Jan 07 22:57:43 2010 +0100
     1.3 @@ -447,12 +447,13 @@
     1.4              port = Integer.parseInt(args[0]);
     1.5          }
     1.6          String remoteAPI = args.length >= 2 ? args[1] : null;
     1.7 +        String remoteStatistics = args.length >= 3 ? args[2] : null;
     1.8  
     1.9          Locale.setDefault(Locale.ROOT);
    1.10  
    1.11 -        Callable<Void> r = startServers(port, remoteAPI);
    1.12 +        Callable<Void> r = startServers(port, remoteAPI, remoteStatistics);
    1.13  
    1.14 -        if (args.length < 2 || !args[args.length - 1].equals("--kill")) {
    1.15 +        if (args.length < 3 || !args[args.length - 1].equals("--kill")) {
    1.16              System.out.println("Hit enter to stop it...");
    1.17              System.in.read();
    1.18          } else {
    1.19 @@ -464,7 +465,7 @@
    1.20          System.exit(0);
    1.21      }
    1.22  
    1.23 -    static Callable<Void> startServers(int port, String remoteAPI) throws Exception {
    1.24 +    static Callable<Void> startServers(int port, String remoteAPI, String remoteStatistics) throws Exception {
    1.25          Client client = new Client();
    1.26          Client client1 = new Client();
    1.27  
    1.28 @@ -473,8 +474,13 @@
    1.29              throw new IllegalArgumentException("Provide URL to API server"); // NOI18N
    1.30          } else {
    1.31              base = client.resource(new URI(remoteAPI));
    1.32 +            apiServer = null;
    1.33 +        }
    1.34 +
    1.35 +        if (remoteStatistics == null) {
    1.36 +            throw new IllegalArgumentException("Provide URL to API server"); // NOI18N
    1.37 +        } else {
    1.38              stat = client1.resource(new URI("http://localhost:9444"));
    1.39 -            apiServer = null;
    1.40          }
    1.41  
    1.42          ResourceConfig rc = new PackagesResourceConfig(