X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fhttpserver%2FHttpServer.java;h=8797f331bfb7a10b6f7dd379ff9d6842ba28b08e;hb=47806656477f02076cac0467c7374e231a59ab7e;hp=02c83809fdd2a0552989dc28e0104d48386d2233;hpb=53b2ec17b88081e402f60deab2723750bc4867d1;p=jalview.git diff --git a/src/jalview/httpserver/HttpServer.java b/src/jalview/httpserver/HttpServer.java index 02c8380..8797f33 100644 --- a/src/jalview/httpserver/HttpServer.java +++ b/src/jalview/httpserver/HttpServer.java @@ -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