package edu.washington.escience.myriad.api;

import javax.ws.rs.GET;
import javax.ws.rs.Path;

/**
 * This is the class that handles API calls that return workers.
 * 
 * @author jwang
 */
@Path("/server")
public final class MasterResource {
  /**
   * Shutdown the server.
   */
  @GET
  @Path("/shutdown")
  public void shutdown() {
    MasterApiServer.getMyriaServer().shutdown();
    Thread shutdownThread = new Thread() {
      @Override
      public void run() {
        try {
          MasterApiServer.INSTANCE.stop();
        } catch (Exception e) {
          e.printStackTrace();
        }
      }
    };
    shutdownThread.setName("MasterResource-Shutdown");
    shutdownThread.start();
  }
}

@@ -86,16 +86,50 @@
 rs.Path;
+%0Aimport javax.ws.rs.core.Response;
 %0A%0A/**%0A *
@@ -301,16 +301,70 @@
 server.%0A
+   * %0A   * @return an HTTP 204 (NO CONTENT) response.%0A
    */%0A  
@@ -398,20 +398,24 @@
  public 
-void
+Response
  shutdow
@@ -782,14 +782,55 @@
 tart();%0A
+    return Response.noContent().build();%0A
   %7D%0A%7D%0A

return an empty HTTP OK when shutting down