From d75133dee8f32fba5553f2bdd0dfb41870ea5862 Mon Sep 17 00:00:00 2001 From: BobHanson Date: Mon, 8 Jun 2020 16:56:30 -0500 Subject: [PATCH] HttpsServer singleton --- src/jalview/httpserver/HttpServer.java | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) 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(). -- 1.7.10.2