JAL-3253 jalview.bin.Instance streamlining
[jalview.git] / src / jalview / httpserver / HttpServer.java
index 02c8380..8797f33 100644 (file)
@@ -52,11 +52,6 @@ import org.eclipse.jetty.util.thread.QueuedThreadPool;
  */
 public class HttpServer
 {
-  /*
-   * 'context root' - actually just prefixed to the path for each handler for
-   * now - see registerHandler
-   */
-  private static final String JALVIEW_PATH = "jalview";
 
   /**
    * Returns the singleton instance of this class.
@@ -74,6 +69,30 @@ public class HttpServer
     }
   }
 
+  /**
+   * Private constructor to enforce use of singleton; use getInstance().
+   * 
+   * @throws BindException
+   *           if no free port can be assigned
+   */
+  private HttpServer() throws BindException
+  {
+    // use getInstance()
+
+    startServer();
+
+    /*
+     * Provides a REST server by default; add more programmatically as required
+     */
+    registerHandler(RestHandler.getInstance());
+  }
+
+  /*
+   * 'context root' - actually just prefixed to the path for each handler for
+   * now - see registerHandler
+   */
+  private static final String JALVIEW_PATH = "jalview";
+
   /*
    * The Http server
    */
@@ -95,22 +114,6 @@ public class HttpServer
   private URI contextRoot;
 
   /**
-   * Private constructor to enforce use of singleton
-   * 
-   * @throws BindException
-   *           if no free port can be assigned
-   */
-  private HttpServer() throws BindException
-  {
-    startServer();
-
-    /*
-     * Provides a REST server by default; add more programmatically as required
-     */
-    registerHandler(RestHandler.getInstance());
-  }
-
-  /**
    * Start the http server
    * 
    * @throws BindException