JAL-3210 Barebones gradle/buildship/eclipse. See README
[jalview.git] / src / jalview / rest / RestHandler.java
index 7c8c9a6..a37882f 100644 (file)
@@ -20,8 +20,6 @@
  */
 package jalview.rest;
 
-import jalview.bin.ApplicationSingletonProvider;
-import jalview.bin.ApplicationSingletonProvider.ApplicationSingletonI;
 import jalview.httpserver.AbstractRequestHandler;
 
 import java.io.IOException;
@@ -32,16 +30,20 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
 /**
- * A simple handler to process (or delegate) HTTP requests on /jalview/rest.
+ * A simple handler to process (or delegate) HTTP requests on /jalview/rest
  */
 public class RestHandler extends AbstractRequestHandler
-        implements ApplicationSingletonI
 {
   private static final String MY_PATH = "rest";
 
   private static final String MY_NAME = "Rest";
 
   /**
+   * Singleton instance of this class
+   */
+  private static RestHandler instance = null;
+
+  /**
    * Returns the singleton instance of this class
    * 
    * @return
@@ -51,8 +53,12 @@ public class RestHandler extends AbstractRequestHandler
   {
     synchronized (RestHandler.class)
     {
-      return (RestHandler) ApplicationSingletonProvider.getInstance(RestHandler.class);
+      if (instance == null)
+      {
+        instance = new RestHandler();
+      }
     }
+    return instance;
   }
 
   /**