X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fhttpserver%2FHttpServer.java;h=b58b01f139c94bebce43c64336461269f9bb81ef;hb=d18e36d8f4a511e82af3564647b3154267b177c6;hp=8cb184625c37e95e71775812d56ac04c74360b79;hpb=f6a84063f10ea1ae9898310c541961cd1d53dd8a;p=jalview.git diff --git a/src/jalview/httpserver/HttpServer.java b/src/jalview/httpserver/HttpServer.java index 8cb1846..b58b01f 100644 --- a/src/jalview/httpserver/HttpServer.java +++ b/src/jalview/httpserver/HttpServer.java @@ -53,7 +53,6 @@ import org.eclipse.jetty.util.thread.QueuedThreadPool; */ public class HttpServer implements ApplicationSingletonI { - /** * Returns the singleton instance of this class. * @@ -64,28 +63,10 @@ public class HttpServer implements ApplicationSingletonI { synchronized (HttpServer.class) { - return (HttpServer) ApplicationSingletonProvider.getInstance(HttpServer.class); + return (HttpServer) ApplicationSingletonProvider + .getInstance(HttpServer.class); } } - - /** - * 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 @@ -112,6 +93,25 @@ public class HttpServer implements ApplicationSingletonI */ private URI contextRoot; + + /** + * 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()); + } + /** * Start the http server *