JAL-3070 detect presence of existing JABA RNAAliFold client
[jalview.git] / src / jalview / ws / AWSThread.java
index 2ef5256..36e51c5 100644 (file)
@@ -116,9 +116,13 @@ public abstract class AWSThread extends Thread
         {
           StartJob(jobs[j]);
         }
-
+        Cache.log.debug("Job " + jobs[j] + " is " + (jobs[j].submitted ? "submitted" : "not submitted"));
         if (jobs[j].submitted && !jobs[j].subjobComplete)
         {
+          jalview.bin.Cache.log.debug(
+              "Polling Job " + j + " Result state was:" + jobs[j].getState() + "(ServerError=" + jobs[j].isServerError()
+                  + ")"
+          );
           try
           {
             pollJob(jobs[j]);
@@ -134,8 +138,8 @@ public abstract class AWSThread extends Thread
           {
             // Deal with Transaction exceptions
             wsInfo.appendProgressText(jobs[j].jobnum, MessageManager
-                    .formatMessage("info.server_exception", new Object[] {
-                        WebServiceName, ex.getMessage() }));
+                    .formatMessage("info.server_exception", new Object[]
+                    { WebServiceName, ex.getMessage() }));
             // always output the exception's stack trace to the log
             Cache.log.warn(WebServiceName + " job(" + jobs[j].jobnum
                     + ") Server exception.");
@@ -169,8 +173,8 @@ public abstract class AWSThread extends Thread
                     WebserviceInfo.STATE_STOPPED_ERROR);
             Cache.log.error("Out of memory when retrieving Job " + j
                     + " id:" + WsUrl + "/" + jobs[j].jobId, er);
-            new jalview.gui.OOMWarning("retrieving result for "
-                    + WebServiceName, er);
+            new jalview.gui.OOMWarning(
+                    "retrieving result for " + WebServiceName, er);
             System.gc();
           }
         }
@@ -185,10 +189,10 @@ public abstract class AWSThread extends Thread
           Thread.sleep(5000);
         } catch (InterruptedException e)
         {
-          Cache.log
-                  .debug("Interrupted sleep waiting for next job poll.", e);
+          Cache.log.debug("Interrupted sleep waiting for next job poll.",
+                  e);
         }
-        // System.out.println("I'm alive "+alTitle);
+        // System.out.println("I'm alive ?");
       }
     }
     if (jobComplete && jobs != null)
@@ -197,11 +201,11 @@ public abstract class AWSThread extends Thread
     }
     else
     {
-      Cache.log
-              .debug("WebServiceJob poll loop finished with no jobs created.");
+      Cache.log.debug(
+              "WebServiceJob poll loop finished with no jobs created.");
       wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_ERROR);
-      wsInfo.appendProgressText(MessageManager
-              .getString("info.no_jobs_ran"));
+      wsInfo.appendProgressText(
+              MessageManager.getString("info.no_jobs_ran"));
       wsInfo.setFinishedNoResults();
     }
   }
@@ -383,7 +387,7 @@ public abstract class AWSThread extends Thread
               .getCodonFrames();
       if (cf != null)
       {
-        codonframe = new ArrayList<AlignedCodonFrame>();
+        codonframe = new ArrayList<>();
         codonframe.addAll(cf);
       }
     }