From: BobHanson Date: Mon, 8 Jun 2020 21:56:30 +0000 (-0500) Subject: HttpsServer singleton X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=d75133dee8f32fba5553f2bdd0dfb41870ea5862;p=jalview.git HttpsServer singleton --- diff --git a/src/jalview/httpserver/HttpServer.java b/src/jalview/httpserver/HttpServer.java index f2daf2b..b58b01f 100644 --- a/src/jalview/httpserver/HttpServer.java +++ b/src/jalview/httpserver/HttpServer.java @@ -53,6 +53,20 @@ import org.eclipse.jetty.util.thread.QueuedThreadPool; */ public class HttpServer implements ApplicationSingletonI { + /** + * Returns the singleton instance of this class. + * + * @return + * @throws BindException + */ + public static HttpServer getInstance() throws BindException + { + synchronized (HttpServer.class) + { + return (HttpServer) ApplicationSingletonProvider + .getInstance(HttpServer.class); + } + } /* * 'context root' - actually just prefixed to the path for each handler for * now - see registerHandler @@ -79,19 +93,6 @@ public class HttpServer implements ApplicationSingletonI */ private URI contextRoot; - /** - * Returns the singleton instance of this class. - * - * @return - * @throws BindException - */ - public static HttpServer getInstance() throws BindException - { - synchronized (HttpServer.class) - { - return (HttpServer) ApplicationSingletonProvider.getInstance(HttpServer.class); - } - } /** * Private constructor to enforce use of singleton; use getInstance().