Refactoring: rename duplicated Util classes
[jabaws.git] / engine / compbio / engine / local / AsyncLocalRunner.java
index d269aad..084cc34 100644 (file)
@@ -27,7 +27,7 @@ import compbio.engine.AsyncExecutor;
 import compbio.engine.Configurator;\r
 import compbio.engine.SubmissionManager;\r
 import compbio.engine.client.ConfiguredExecutable;\r
-import compbio.engine.client.Util;\r
+import compbio.engine.client.EngineUtil;\r
 import compbio.metadata.JobStatus;\r
 import compbio.metadata.JobSubmissionException;\r
 import compbio.metadata.ResultNotAvailableException;\r
@@ -43,8 +43,7 @@ public final class AsyncLocalRunner implements AsyncExecutor {
 \r
        @Override\r
        public boolean cancelJob(String jobId) {\r
-               Future<ConfiguredExecutable<?>> future = SubmissionManager\r
-                               .getTask(jobId);\r
+               Future<ConfiguredExecutable<?>> future = SubmissionManager.getTask(jobId);\r
                // The job has already finished or cancelled.\r
                if (future == null) {\r
                        log.debug("Did not find future for local job "\r
@@ -58,8 +57,7 @@ public final class AsyncLocalRunner implements AsyncExecutor {
 \r
        @Override\r
        public JobStatus getJobStatus(String jobId) {\r
-               Future<ConfiguredExecutable<?>> future = SubmissionManager\r
-                               .getTask(jobId);\r
+               Future<ConfiguredExecutable<?>> future = SubmissionManager.getTask(jobId);\r
                if (future == null) {\r
                        return LocalEngineUtil.getRecordedJobStatus(jobId);\r
                }\r
@@ -77,8 +75,7 @@ public final class AsyncLocalRunner implements AsyncExecutor {
                Future<ConfiguredExecutable<?>> future = lrunner.getFuture();\r
 \r
                if (future == null) {\r
-                       throw new RuntimeException("Future is NULL for executable "\r
-                                       + executable);\r
+                       throw new RuntimeException("Future is NULL for executable " + executable);\r
                }\r
                SubmissionManager.addTask(executable, future);\r
                return executable.getTaskId();\r
@@ -97,11 +94,9 @@ public final class AsyncLocalRunner implements AsyncExecutor {
                try {\r
                        cexec = future.get();\r
                } catch (InterruptedException e) {\r
-                       log.error("Cannot clean up as calculation was not completed!"\r
-                                       + e.getLocalizedMessage());\r
+                       log.error("Cannot clean up as calculation was not completed!" + e.getLocalizedMessage());\r
                } catch (ExecutionException e) {\r
-                       log.error("Cannot clean up due to ExecutionException "\r
-                                       + e.getLocalizedMessage());\r
+                       log.error("Cannot clean up due to ExecutionException " + e.getLocalizedMessage());\r
                }\r
                if (cexec == null) {\r
                        return false;\r
@@ -112,7 +107,7 @@ public final class AsyncLocalRunner implements AsyncExecutor {
        @Override\r
        public ConfiguredExecutable<?> getResults(String taskId)\r
                        throws ResultNotAvailableException {\r
-               if (!Util.isValidJobId(taskId)) {\r
+               if (!EngineUtil.isValidJobId(taskId)) {\r
                        // TODO should I be throwing something else?\r
                        throw new IllegalArgumentException(taskId);\r
                }\r
@@ -122,8 +117,7 @@ public final class AsyncLocalRunner implements AsyncExecutor {
                        // If task was not find in the list of jobs, than it must have been\r
                        // collected already\r
                        // Resurrect the job to find out there the output is\r
-                       ConfiguredExecutable<?> exec = compbio.engine.client.Util\r
-                                       .loadExecutable(taskId);\r
+                       ConfiguredExecutable<?> exec = EngineUtil.loadExecutable(taskId);\r
                        return exec;\r
                }\r
                return LocalEngineUtil.getResults(futureExec, taskId);\r