fixed brain interruption bug.
authorjprocter <Jim Procter>
Fri, 27 May 2005 15:46:14 +0000 (15:46 +0000)
committerjprocter <Jim Procter>
Fri, 27 May 2005 15:46:14 +0000 (15:46 +0000)
src/jalview/ws/MsaWSClient.java

index 23c4ed4..2141f6f 100755 (executable)
@@ -161,10 +161,10 @@ public class MsaWSClient
         {
           result = server.getResult(jobId);
 
-         if( result.isRunning() )
-           wsInfo.setStatus(WebserviceInfo.STATE_RUNNING);
-         else if( result.isQueued() )
-           wsInfo.setStatus(WebserviceInfo.STATE_QUEUING);
+          if (result.isRunning())
+            wsInfo.setStatus(WebserviceInfo.STATE_RUNNING);
+          else if (result.isQueued())
+            wsInfo.setStatus(WebserviceInfo.STATE_QUEUING);
 
           if (result.isFinished())
           {
@@ -174,13 +174,15 @@ public class MsaWSClient
           }
           else
           {
-            if (result.getStatus()!=null)
+            if (result.getStatus() != null)
               wsInfo.setProgressText(OutputHeader + "\n" + result.getStatus());
             if (! (result.isJobFailed() || result.isServerError()))
             {
               Thread.sleep(5000);
               //  System.out.println("I'm alive "+seqid+" "+jobid);
-            } else {
+            }
+            else
+            {
               break;
             }
           }
@@ -188,21 +190,28 @@ public class MsaWSClient
         catch (Exception ex)
         {
           allowedServerExceptions--;
-          wsInfo.appendProgressText("\n"+ServiceName+" Server exception!\n" + ex.getMessage());
+          wsInfo.appendProgressText("\n" + ServiceName + " Server exception!\n" +
+                                    ex.getMessage());
           ex.printStackTrace();
         }
       }
-      if (allowedServerExceptions==0) {
-        wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_ERROR);
-      } else {
-        if (! (result!=null && (result.isJobFailed() || result.isServerError())))
+      if (allowedServerExceptions == 0)
+      {
+        wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_SERVERERROR);
+      }
+      else
+      {
+        if (! (result != null && (result.isJobFailed() || result.isServerError())))
           wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_OK);
-        else {
-          if (result.isJobFailed()
-
-          wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_ERROR);
+        else
+        {
+          if (result.isFailed())
+            wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_ERROR);
+          if (result.isServerError())
+            wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_SERVERERROR);
         }
-
+      }
+    }
     void StartJob()
     {
       try