Refactoring: rename duplicated Util classes
authorSasha Sherstnev <a.sherstnev@dundee.ac.uk>
Fri, 20 Sep 2013 14:32:07 +0000 (15:32 +0100)
committerSasha Sherstnev <a.sherstnev@dundee.ac.uk>
Fri, 20 Sep 2013 14:32:07 +0000 (15:32 +0100)
60 files changed:
engine/compbio/engine/ClusterJobId.java
engine/compbio/engine/Configurator.java
engine/compbio/engine/Job.java
engine/compbio/engine/SubmissionManager.java
engine/compbio/engine/client/ConfExecutable.java
engine/compbio/engine/client/EngineUtil.java [moved from engine/compbio/engine/client/Util.java with 94% similarity]
engine/compbio/engine/client/EnvVariableProcessor.java
engine/compbio/engine/client/SkeletalExecutable.java
engine/compbio/engine/cluster/drmaa/AsyncJobRunner.java
engine/compbio/engine/cluster/drmaa/ClusterEngineUtil.java [moved from engine/compbio/engine/cluster/drmaa/ClusterUtil.java with 76% similarity]
engine/compbio/engine/cluster/drmaa/ClusterSession.java
engine/compbio/engine/cluster/drmaa/JobRunner.java
engine/compbio/engine/conf/DirectoryManager.java
engine/compbio/engine/local/AsyncLocalRunner.java
engine/compbio/engine/local/ExecutableWrapper.java
engine/compbio/engine/local/LocalEngineUtil.java
runner/compbio/runner/RunnerUtil.java [moved from runner/compbio/runner/Util.java with 90% similarity]
runner/compbio/runner/conservation/AACon.java
runner/compbio/runner/disorder/Disembl.java
runner/compbio/runner/disorder/GlobPlot.java
runner/compbio/runner/disorder/Jronn.java
runner/compbio/runner/msa/ClustalO.java
runner/compbio/runner/msa/ClustalW.java
runner/compbio/runner/msa/Mafft.java
runner/compbio/runner/msa/Muscle.java
runner/compbio/runner/msa/Probcons.java
runner/compbio/runner/msa/Tcoffee.java
runner/compbio/runner/structure/RNAalifold.java
testsrc/compbio/engine/cluster/drmaa/DrmaaClusterEngineTester.java
testsrc/compbio/engine/cluster/drmaa/UtilTester.java
testsrc/compbio/engine/local/AsyncLocalRunnerTester.java
testsrc/compbio/engine/local/LocalRunnerTester.java
testsrc/compbio/runner/conservation/AAConTester.java
testsrc/compbio/runner/disorder/DisemblTester.java
testsrc/compbio/runner/disorder/GlobPlotTester.java
testsrc/compbio/runner/disorder/IUPredTester.java
testsrc/compbio/runner/disorder/JronnTester.java
testsrc/compbio/runner/msa/ClustalOTester.java
testsrc/compbio/runner/msa/ClustalWTester.java
testsrc/compbio/runner/msa/MafftTester.java
testsrc/compbio/runner/msa/MuscleTester.java
testsrc/compbio/runner/msa/ProbconsTester.java
testsrc/compbio/runner/msa/TcoffeeParametersTester.java
testsrc/compbio/runner/predictors/JpredTester.java
testsrc/compbio/runner/structure/RNAalifoldTester.java
webservices/compbio/stat/servlet/ServiceStatus.java
webservices/compbio/stat/servlet/StatisticCollector.java
webservices/compbio/ws/client/WSTester.java
webservices/compbio/ws/server/ClustalOWS.java
webservices/compbio/ws/server/ClustalWS.java
webservices/compbio/ws/server/GAUtils.java
webservices/compbio/ws/server/GenericMetadataService.java
webservices/compbio/ws/server/JpredWS.java
webservices/compbio/ws/server/MafftWS.java
webservices/compbio/ws/server/MainManager.java
webservices/compbio/ws/server/MuscleWS.java
webservices/compbio/ws/server/ProbconsWS.java
webservices/compbio/ws/server/SetExecutableFlag.java
webservices/compbio/ws/server/TcoffeeWS.java
webservices/compbio/ws/server/WSUtil.java

index 9a1f1d1..d578c37 100644 (file)
@@ -20,6 +20,7 @@ package compbio.engine;
 \r
 import compbio.util.Util;\r
 import compbio.util.annotation.Immutable;\r
+import compbio.engine.client.EngineUtil;\r
 \r
 @Immutable\r
 public class ClusterJobId {\r
@@ -30,10 +31,8 @@ public class ClusterJobId {
                if (Util.isEmpty(jobId)) {\r
                        throw new NullPointerException("JobId must be provided!");\r
                }\r
-               if (compbio.engine.client.Util.isValidJobId(jobId)) {\r
-                       throw new IllegalArgumentException(\r
-                                       "JobId is expected but taskid seems to be provided! "\r
-                                                       + jobId);\r
+               if (EngineUtil.isValidJobId(jobId)) {\r
+                       throw new IllegalArgumentException("JobId is expected but taskid seems to be provided! " + jobId);\r
                }\r
                this.jobId = jobId;\r
        }\r
index 96c232d..1aa18ea 100644 (file)
@@ -29,6 +29,7 @@ import compbio.engine.client.ConfExecutable;
 import compbio.engine.client.ConfiguredExecutable;\r
 import compbio.engine.client.Executable;\r
 import compbio.engine.client.PathValidator;\r
+import compbio.engine.client.EngineUtil;\r
 import compbio.engine.cluster.drmaa.AsyncJobRunner;\r
 import compbio.engine.cluster.drmaa.JobRunner;\r
 import compbio.engine.conf.DirectoryManager;\r
@@ -90,7 +91,7 @@ public class Configurator {
                }\r
                if (!PathValidator.isAbsolutePath(tmp_dir)) {\r
                        log.debug("local.tmp.directory path is relative! " + tmp_dir);\r
-                       tmp_dir = compbio.engine.client.Util.convertToAbsolute(tmp_dir);\r
+                       tmp_dir = EngineUtil.convertToAbsolute(tmp_dir);\r
                        log.debug("local.tmp.directory path changed to absolute: " + tmp_dir);\r
                }\r
                return tmp_dir.trim();\r
@@ -303,7 +304,7 @@ public class Configurator {
                if (Util.isEmpty(taskId)) {\r
                        throw new NullPointerException("TaskId must be provided!");\r
                }\r
-               if (!compbio.engine.client.Util.isValidJobId(taskId)) {\r
+               if (!EngineUtil.isValidJobId(taskId)) {\r
                        throw new InvalidParameterException("TaskId is not valid!");\r
                }\r
                return !taskId.startsWith(ConfExecutable.CLUSTER_TASK_ID_PREFIX);\r
@@ -311,7 +312,7 @@ public class Configurator {
 \r
        public static String getWorkDirectory(String taskId) {\r
                assert !compbio.util.Util.isEmpty(taskId);\r
-               assert compbio.engine.client.Util.isValidJobId(taskId);\r
+               assert EngineUtil.isValidJobId(taskId);\r
                log.info("Getting workdirectory for TaskID: " + taskId);\r
                if (taskId.startsWith(ConfExecutable.CLUSTER_TASK_ID_PREFIX)) {\r
                        return CLUSTER_WORK_DIRECTORY + File.separator + taskId;\r
index 6d5f10f..13a3df4 100644 (file)
@@ -21,7 +21,7 @@ package compbio.engine;
 import java.util.List;\r
 \r
 import compbio.engine.client.ConfiguredExecutable;\r
-import compbio.engine.client.Util;\r
+import compbio.engine.client.EngineUtil;\r
 import compbio.util.annotation.Immutable;\r
 \r
 @Immutable\r
@@ -32,7 +32,7 @@ public final class Job {
        private final ConfiguredExecutable<?> cexecutable;\r
 \r
        public Job(String taskId, String jobId, ConfiguredExecutable<?> cexecutable) {\r
-               if (!Util.isValidJobId(taskId)) {\r
+               if (!EngineUtil.isValidJobId(taskId)) {\r
                        throw new IllegalArgumentException("TaskId " + taskId\r
                                        + " is not valid!");\r
                }\r
index 2880e8f..482c70a 100644 (file)
@@ -25,6 +25,7 @@ import java.util.concurrent.Future;
 import org.apache.log4j.Logger;\r
 \r
 import compbio.engine.client.ConfiguredExecutable;\r
+import compbio.engine.client.EngineUtil;\r
 \r
 /**\r
  * Submit jobs for execution\r
@@ -58,14 +59,14 @@ public class SubmissionManager {
                synchronized (submittedTasks) {\r
                        assert executable != null;\r
                        String taskId = executable.getTaskId();\r
-                       assert compbio.engine.client.Util.isValidJobId(taskId);\r
+                       assert EngineUtil.isValidJobId(taskId);\r
                        submittedTasks.remove(taskId);\r
                }\r
        }\r
 \r
        public static void removeTask(String key) {\r
                synchronized (submittedTasks) {\r
-                       if (compbio.engine.client.Util.isValidJobId(key)) {\r
+                       if (EngineUtil.isValidJobId(key)) {\r
                                submittedTasks.remove(key);\r
                        } else {\r
                                log.error("Invalid key is given! " + key);\r
index d8260c8..e64d212 100644 (file)
@@ -96,8 +96,7 @@ public class ConfExecutable<T> implements ConfiguredExecutable<T> {
        @Override\r
        public String getCommand(ExecProvider provider)\r
                        throws UnsupportedRuntimeException {\r
-               String command = compbio.engine.client.Util.getCommand(provider,\r
-                               exec.getClass());\r
+               String command = EngineUtil.getCommand(provider, exec.getClass());\r
                if (Util.isEmpty(command)) {\r
                        throw new UnsupportedRuntimeException(\r
                                        "Executable "\r
@@ -112,7 +111,7 @@ public class ConfExecutable<T> implements ConfiguredExecutable<T> {
 \r
        @Override\r
        public ExecProvider getSupportedRuntimes() {\r
-               return compbio.engine.client.Util.getSupportedRuntimes(exec.getClass());\r
+               return EngineUtil.getSupportedRuntimes(exec.getClass());\r
        }\r
 \r
        @Override\r
@@ -165,8 +164,7 @@ public class ConfExecutable<T> implements ConfiguredExecutable<T> {
        List<String> getFullPath(List<String> fileNames) {\r
                List<String> files = new ArrayList<String>();\r
                for (String fileName : fileNames) {\r
-                       files.add(compbio.engine.client.Util.getFullPath(workDirectory,\r
-                                       fileName));\r
+                       files.add(EngineUtil.getFullPath(workDirectory, fileName));\r
                }\r
                return files;\r
        }\r
@@ -182,7 +180,7 @@ public class ConfExecutable<T> implements ConfiguredExecutable<T> {
                if (PathValidator.isAbsolutePath(path)) {\r
                        return path;\r
                }\r
-               return compbio.engine.client.Util.getFullPath(workDirectory, path);\r
+               return EngineUtil.getFullPath(workDirectory, path);\r
        }\r
 \r
        @Override\r
similarity index 94%
rename from engine/compbio/engine/client/Util.java
rename to engine/compbio/engine/client/EngineUtil.java
index 5eda4b6..e5eb946 100644 (file)
@@ -38,12 +38,12 @@ import compbio.util.FileUtil;
 import compbio.util.PropertyHelper;\r
 import compbio.util.SysPrefs;\r
 \r
-public final class Util {\r
+public final class EngineUtil {\r
 \r
        private static final PropertyHelper ph = PropertyHelperManager\r
                        .getPropertyHelper();\r
 \r
-       private static final Logger log = Logger.getLogger(Util.class);\r
+       private static final Logger log = Logger.getLogger(EngineUtil.class);\r
 \r
        public static boolean isValidJobId(final String key) {\r
                if (compbio.util.Util.isEmpty(key)) {\r
@@ -184,7 +184,7 @@ public final class Util {
                String absolute = relativePath;\r
                if (!PathValidator.isAbsolutePath(relativePath)) {\r
                        absolute = PropertyHelperManager.getLocalPath() + relativePath;\r
-                       Util.log.trace("Changing local path in enviromental variable to absolute: FROM "\r
+                       EngineUtil.log.trace("Changing local path in enviromental variable to absolute: FROM "\r
                                        + relativePath + " TO " + absolute);\r
                }\r
                return absolute;\r
@@ -193,7 +193,7 @@ public final class Util {
        public static String getExecProperty(String propertySpec, Executable<?> exec) {\r
                assert !compbio.util.Util.isEmpty(propertySpec);\r
                assert exec != null;\r
-               return Util.getExecProperty(propertySpec, exec.getClass());\r
+               return EngineUtil.getExecProperty(propertySpec, exec.getClass());\r
        }\r
 \r
        public static String getExecProperty(String propertySpec, Class<?> clazz) {\r
@@ -403,11 +403,11 @@ public final class Util {
                try {\r
                        limits = ConfExecutable.getRunnerLimits(clazz);\r
                } catch (FileNotFoundException e) {\r
-                       Util.log.warn("No limits are found for " + clazz + " executable! "\r
+                       EngineUtil.log.warn("No limits are found for " + clazz + " executable! "\r
                                        + e.getLocalizedMessage(), e.getCause());\r
                        // its ok, limit may not be initialized\r
                } catch (IOException e) {\r
-                       Util.log.warn("IO exception while attempting to read limits for "\r
+                       EngineUtil.log.warn("IO exception while attempting to read limits for "\r
                                        + clazz + " executable! " + e.getLocalizedMessage(),\r
                                        e.getCause());\r
                }\r
index 5d161df..c78886e 100644 (file)
@@ -18,7 +18,6 @@
 \r
 package compbio.engine.client;\r
 \r
-import java.util.Arrays;\r
 import java.util.Collections;\r
 import java.util.Map;\r
 \r
@@ -79,8 +78,6 @@ public class EnvVariableProcessor {
                return property.contains(PROP_NAME_VALUE_SEPARATOR);\r
        }\r
 \r
-\r
-\r
        /*\r
         * This is a horrible hack, but it only requires to simplify configuration\r
         * for users, could be removed at any time if proved to be a burden to\r
@@ -113,8 +110,7 @@ public class EnvVariableProcessor {
                                if (varName.equalsIgnoreCase(mafft_binaries)\r
                                                || varName.equalsIgnoreCase(fasta4mafft)\r
                                                || varName.equalsIgnoreCase(iupred_path)) {\r
-                                       varValue = compbio.engine.client.Util\r
-                                                       .convertToAbsolute(varValue);\r
+                                       varValue = EngineUtil.convertToAbsolute(varValue);\r
                                }\r
                        }\r
                        vars.put(varName, varValue);\r
index b991440..dbdff47 100644 (file)
@@ -133,8 +133,7 @@ public abstract class SkeletalExecutable<T> implements Executable<T> {
                        if (command.value == null) {\r
                                continue;\r
                        }\r
-                       String propertyPath = compbio.engine.client.Util.getExecProperty(\r
-                                       command.name + ".path", getType());\r
+                       String propertyPath = EngineUtil.getExecProperty(command.name + ".path", getType());\r
                        if (Util.isEmpty(propertyPath)) {\r
                                continue;\r
                        }\r
@@ -145,7 +144,7 @@ public abstract class SkeletalExecutable<T> implements Executable<T> {
                                // necessary\r
                                continue;\r
                        }\r
-                       String absMatrixPath = compbio.engine.client.Util.convertToAbsolute(propertyPath);\r
+                       String absMatrixPath = EngineUtil.convertToAbsolute(propertyPath);\r
                        command.value = absMatrixPath + File.separator + command.value;\r
                        cbuilder.setParam(command);\r
                }\r
@@ -313,7 +312,7 @@ public abstract class SkeletalExecutable<T> implements Executable<T> {
        public LimitsManager<T> getLimits() {\r
                synchronized (SkeletalExecutable.class) {\r
                        if (limits == null) {\r
-                               limits = compbio.engine.client.Util.getLimits(this.getType());\r
+                               limits = EngineUtil.getLimits(this.getType());\r
                        }\r
                }\r
                return limits;\r
index db50916..1cd3197 100644 (file)
@@ -25,7 +25,7 @@ import compbio.engine.AsyncExecutor;
 import compbio.engine.Cleaner;\r
 import compbio.engine.Configurator;\r
 import compbio.engine.client.ConfiguredExecutable;\r
-import compbio.engine.client.Util;\r
+import compbio.engine.client.EngineUtil;\r
 import compbio.metadata.JobSubmissionException;\r
 import compbio.metadata.ResultNotAvailableException;\r
 \r
@@ -54,7 +54,7 @@ public class AsyncJobRunner implements AsyncExecutor {
        @Override\r
        public boolean cancelJob(String jobId) {\r
                ClusterSession clustSession = ClusterSession.getInstance();\r
-               return compbio.engine.cluster.drmaa.ClusterUtil.cancelJob(jobId,\r
+               return compbio.engine.cluster.drmaa.ClusterEngineUtil.cancelJob(jobId,\r
                                clustSession);\r
        }\r
 \r
@@ -77,7 +77,7 @@ public class AsyncJobRunner implements AsyncExecutor {
        public ConfiguredExecutable<?> getResults(String jobId)\r
                        throws ResultNotAvailableException {\r
 \r
-               assert Util.isValidJobId(jobId);\r
+               assert EngineUtil.isValidJobId(jobId);\r
 \r
                ClusterSession csession = ClusterSession.getInstance();\r
                ConfiguredExecutable<?> exec;\r
@@ -26,16 +26,15 @@ import org.ggf.drmaa.JobInfo;
 import org.ggf.drmaa.Session;\r
 \r
 import compbio.engine.Configurator;\r
-import compbio.engine.client.Util;\r
+import compbio.engine.client.EngineUtil;\r
 import compbio.metadata.JobExecutionException;\r
 import compbio.metadata.JobStatus;\r
 \r
-public class ClusterUtil {\r
+public class ClusterEngineUtil {\r
 \r
-       private static final Logger log = Logger.getLogger(ClusterUtil.class);\r
+       private static final Logger log = Logger.getLogger(ClusterEngineUtil.class);\r
 \r
-       public static final NumberFormat CLUSTER_STAT_IN_SEC = NumberFormat\r
-                       .getInstance();\r
+       public static final NumberFormat CLUSTER_STAT_IN_SEC = NumberFormat.getInstance();\r
 \r
        static {\r
                CLUSTER_STAT_IN_SEC.setMinimumFractionDigits(4);\r
@@ -43,30 +42,23 @@ public class ClusterUtil {
 \r
        public static final boolean cancelJob(final String jobId,\r
                        ClusterSession csession) {\r
-               assert Util.isValidJobId(jobId);\r
+               assert EngineUtil.isValidJobId(jobId);\r
                boolean cancelled = true;\r
                Session session = csession.getSession();\r
                try {\r
                        log.info("Job " + jobId + " is successfully cancelled");\r
-                       compbio.engine.client.Util.writeMarker(Configurator.getWorkDirectory(jobId),\r
-                                       JobStatus.CANCELLED);\r
-                       session.control(ClusterSession.getClusterJobId(jobId).getJobId(),\r
-                                       Session.TERMINATE);\r
+                       EngineUtil.writeMarker(Configurator.getWorkDirectory(jobId), JobStatus.CANCELLED);\r
+                       session.control(ClusterSession.getClusterJobId(jobId).getJobId(), Session.TERMINATE);\r
                } catch (DrmaaException e) {\r
                        // Log silently\r
                        log.error("Job " + jobId + " cancellation failed!");\r
                        log.error("Cause: " + e.getLocalizedMessage(), e.getCause());\r
                        cancelled = false;\r
                } catch (IOException e) {\r
-                       log.error(\r
-                                       "Could not read JOBID file to determine cluster jobid for taskid: "\r
-                                                       + jobId + " Message: " + e.getLocalizedMessage(), e\r
-                                                       .getCause());\r
+                       log.error("Could not read JOBID file to determine cluster jobid for taskid: "\r
+                                                       + jobId + " Message: " + e.getLocalizedMessage(), e.getCause());\r
                } finally {\r
-                       log\r
-                                       .trace("Job "\r
-                                                       + jobId\r
-                                                       + " has been successfully removed from the cluster engine job list");\r
+                       log.trace("Job " + jobId + " has been successfully removed from the cluster engine job list");\r
                        csession.removeJob(jobId);\r
                }\r
                return cancelled;\r
@@ -75,7 +67,7 @@ public class ClusterUtil {
        public static final JobInfo waitForResult(ClusterSession csession,\r
                        String jobId) throws JobExecutionException {\r
                JobInfo jinfo = null;\r
-               assert Util.isValidJobId(jobId);\r
+               assert EngineUtil.isValidJobId(jobId);\r
                try {\r
                        jinfo = csession.waitForJob(jobId);\r
                } catch (DrmaaException e) {\r
index ca2f531..431c39f 100644 (file)
@@ -33,8 +33,10 @@ import org.ggf.drmaa.SessionFactory;
 \r
 import compbio.engine.ClusterJobId;\r
 import compbio.engine.Job;\r
+import compbio.engine.Configurator;\r
 import compbio.engine.client.ConfiguredExecutable;\r
 import compbio.engine.client.PathValidator;\r
+import compbio.engine.client.EngineUtil;\r
 import compbio.engine.conf.PropertyHelperManager;\r
 import compbio.metadata.JobStatus;\r
 import compbio.metadata.ResultNotAvailableException;\r
@@ -136,18 +138,16 @@ public final class ClusterSession {
                                + taskDirectory;\r
                assert !Util.isEmpty(jobId);\r
 \r
-               compbio.engine.client.Util.writeStatFile(executable.getWorkDirectory(),\r
-                               JobStatus.SUBMITTED.toString());\r
-               compbio.engine.client.Util.writeFile(executable.getWorkDirectory(),\r
-                               JOBID, jobId, false);\r
+               EngineUtil.writeStatFile(executable.getWorkDirectory(), JobStatus.SUBMITTED.toString());\r
+               EngineUtil.writeFile(executable.getWorkDirectory(), JOBID, jobId, false);\r
                log.debug("Adding taskId: " + taskDirectory + " to cluster job list");\r
-               assert compbio.engine.client.Util.isValidJobId(taskDirectory);\r
+               assert EngineUtil.isValidJobId(taskDirectory);\r
                jobs.add(new Job(taskDirectory, jobId, executable));\r
        }\r
 \r
        public void removeJob(String taskId) {\r
                assert !Util.isEmpty(taskId);\r
-               assert compbio.engine.client.Util.isValidJobId(taskId);\r
+               assert EngineUtil.isValidJobId(taskId);\r
                removeJobFromListbyTaskId(taskId);\r
        }\r
 \r
@@ -207,9 +207,7 @@ public final class ClusterSession {
                // Once the job has been waited for it will be finished\r
                // Next time it will not be found in the session, so removed from the\r
                // job list\r
-               compbio.engine.client.Util.writeStatFile(\r
-                               compbio.engine.Configurator.getWorkDirectory(jobId),\r
-                               JobStatus.FINISHED.toString());\r
+               EngineUtil.writeStatFile(Configurator.getWorkDirectory(jobId), JobStatus.FINISHED.toString());\r
 \r
                return status;\r
        }\r
@@ -226,7 +224,7 @@ public final class ClusterSession {
        public ConfiguredExecutable<?> getResults(String taskId)\r
                        throws DrmaaException, ResultNotAvailableException {\r
 \r
-               compbio.engine.client.Util.isValidJobId(taskId);\r
+               EngineUtil.isValidJobId(taskId);\r
                try {\r
                        JobInfo status = waitForJob(taskId);\r
                } catch (InvalidJobException e) {\r
@@ -249,10 +247,10 @@ public final class ClusterSession {
                        // 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
-                       exec = compbio.engine.client.Util.loadExecutable(taskId);\r
+                       exec = EngineUtil.loadExecutable(taskId);\r
                }\r
                if (exec != null) {\r
-                       compbio.engine.client.Util.writeMarker(exec.getWorkDirectory(),\r
+                       EngineUtil.writeMarker(exec.getWorkDirectory(),\r
                                        JobStatus.COLLECTED);\r
                }\r
                return exec;\r
index a3f002a..516c3eb 100644 (file)
@@ -39,7 +39,7 @@ import compbio.engine.client.ConfiguredExecutable;
 import compbio.engine.client.Executable;\r
 import compbio.engine.client.PathValidator;\r
 import compbio.engine.client.PipedExecutable;\r
-import compbio.engine.client.Util;\r
+import compbio.engine.client.EngineUtil;\r
 import compbio.engine.client.Executable.ExecProvider;\r
 import compbio.metadata.JobExecutionException;\r
 import compbio.metadata.JobStatus;\r
@@ -195,7 +195,7 @@ public class JobRunner implements SyncExecutor {
                        log.trace("Setting job environment to:" + env_variables);\r
                        Map<String, String> sysEnv = jobtempl.getJobEnvironment();\r
                        if (sysEnv != null && !sysEnv.isEmpty()) {\r
-                               Util.mergeEnvVariables(sysEnv, env_variables);\r
+                               EngineUtil.mergeEnvVariables(sysEnv, env_variables);\r
                        } else {\r
                                sysEnv = env_variables;\r
                        }\r
@@ -231,14 +231,11 @@ public class JobRunner implements SyncExecutor {
                        ClusterJobId clusterJobId = ClusterSession.getClusterJobId(jobId);\r
                        switch (clustSession.getJobStatus(clusterJobId)) {\r
                        case Session.DONE:\r
-                               compbio.engine.client.Util.writeStatFile(Configurator.getWorkDirectory(jobId),\r
-                                               JobStatus.FINISHED.toString());\r
-\r
+                               EngineUtil.writeStatFile(Configurator.getWorkDirectory(jobId), JobStatus.FINISHED.toString());\r
                                return compbio.metadata.JobStatus.FINISHED;\r
-                       case Session.FAILED:\r
-                               compbio.engine.client.Util.writeMarker(Configurator.getWorkDirectory(jobId),\r
-                                               JobStatus.FAILED);\r
 \r
+                       case Session.FAILED:\r
+                               EngineUtil.writeMarker(Configurator.getWorkDirectory(jobId), JobStatus.FAILED);\r
                                return compbio.metadata.JobStatus.FAILED;\r
 \r
                        case Session.RUNNING:\r
@@ -285,14 +282,14 @@ public class JobRunner implements SyncExecutor {
                 * cancelled, finished or failed.\r
                 */\r
                String workDir = Configurator.getWorkDirectory(jobId);\r
-               if (Util.isMarked(workDir, JobStatus.FINISHED)\r
-                               || Util.isMarked(workDir, JobStatus.COLLECTED)) {\r
+               if (EngineUtil.isMarked(workDir, JobStatus.FINISHED)\r
+                               || EngineUtil.isMarked(workDir, JobStatus.COLLECTED)) {\r
                        return JobStatus.FINISHED;\r
                }\r
-               if (Util.isMarked(workDir, JobStatus.CANCELLED)) {\r
+               if (EngineUtil.isMarked(workDir, JobStatus.CANCELLED)) {\r
                        return JobStatus.CANCELLED;\r
                }\r
-               if (Util.isMarked(workDir, JobStatus.FAILED)) {\r
+               if (EngineUtil.isMarked(workDir, JobStatus.FAILED)) {\r
                        return JobStatus.FAILED;\r
                }\r
                return JobStatus.UNDEFINED; \r
@@ -315,13 +312,13 @@ public class JobRunner implements SyncExecutor {
        }\r
 \r
        JobInfo waitForJob(String jobId) throws JobExecutionException {\r
-               assert Util.isValidJobId(jobId);\r
-               return ClusterUtil.waitForResult(clustSession, jobId);\r
+               assert EngineUtil.isValidJobId(jobId);\r
+               return ClusterEngineUtil.waitForResult(clustSession, jobId);\r
        }\r
 \r
        boolean cancelJob(String jobId) {\r
-               assert Util.isValidJobId(jobId);\r
-               return compbio.engine.cluster.drmaa.ClusterUtil.cancelJob(jobId,\r
+               assert EngineUtil.isValidJobId(jobId);\r
+               return compbio.engine.cluster.drmaa.ClusterEngineUtil.cancelJob(jobId,\r
                                clustSession);\r
        }\r
 \r
index adceacc..6b59d20 100644 (file)
@@ -22,6 +22,7 @@ import org.apache.log4j.Logger;
 \r
 import compbio.engine.client.ConfExecutable;\r
 import compbio.engine.client.Executable;\r
+import compbio.engine.client.EngineUtil;\r
 import compbio.util.Util;\r
 \r
 public class DirectoryManager {\r
@@ -45,7 +46,7 @@ public class DirectoryManager {
        }\r
 \r
        public static Class<Executable<?>> getClass(String taskId) {\r
-               assert compbio.engine.client.Util.isValidJobId(taskId);\r
+               assert EngineUtil.isValidJobId(taskId);\r
                String className = null;\r
                if (taskId.startsWith(ConfExecutable.CLUSTER_TASK_ID_PREFIX)) {\r
                        className = taskId.substring(1, taskId.indexOf(DELIM));\r
@@ -55,9 +56,7 @@ public class DirectoryManager {
                try {\r
                        return (Class<Executable<?>>) Class.forName(className);\r
                } catch (ClassNotFoundException e) {\r
-                       log.error(\r
-                                       "Could not parse taskId " + taskId + " Message "\r
-                                                       + e.getLocalizedMessage(), e.getCause());\r
+                       log.error("Could not parse taskId " + taskId + " Message " + e.getLocalizedMessage(), e.getCause());\r
                }\r
                return null;\r
        }\r
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
index 8718013..b9bf00a 100644 (file)
@@ -38,7 +38,7 @@ import org.apache.log4j.Logger;
 import compbio.engine.client.ConfiguredExecutable;\r
 import compbio.engine.client.PathValidator;\r
 import compbio.engine.client.PipedExecutable;\r
-import compbio.engine.client.Util;\r
+import compbio.engine.client.EngineUtil;\r
 import compbio.engine.client.Executable.ExecProvider;\r
 import compbio.engine.local.StreamGobbler.OutputType;\r
 import compbio.metadata.JobStatus;\r
@@ -77,7 +77,7 @@ public final class ExecutableWrapper implements
        pbuilder = new ProcessBuilder(params);\r
        if (executable.getEnvironment() != null) {\r
                log.debug("Setting command environment variables: " + pbuilder.environment());\r
-               Util.mergeEnvVariables(pbuilder.environment(), executable.getEnvironment());\r
+               EngineUtil.mergeEnvVariables(pbuilder.environment(), executable.getEnvironment());\r
                log.debug("Process environment:" + pbuilder.environment());\r
        }\r
        log.debug("Setting command: " + pbuilder.command());\r
@@ -138,7 +138,7 @@ public final class ExecutableWrapper implements
 \r
     try {\r
                log.info("Calculation started at " + System.nanoTime());\r
-               Util.writeStatFile(confExec.getWorkDirectory(), JobStatus.STARTED.toString());\r
+               EngineUtil.writeStatFile(confExec.getWorkDirectory(), JobStatus.STARTED.toString());\r
                proc = pbuilder.start();\r
 \r
                // store input command and program environment\r
@@ -168,7 +168,7 @@ public final class ExecutableWrapper implements
                // any error???\r
                int exitVal = proc.waitFor();\r
                log.info("Calculation completed at " + System.nanoTime());\r
-               Util.writeStatFile(confExec.getWorkDirectory(), JobStatus.FINISHED.toString());\r
+               EngineUtil.writeStatFile(confExec.getWorkDirectory(), JobStatus.FINISHED.toString());\r
                // Let streams to write for a little more\r
                errorf.get(2, TimeUnit.SECONDS);\r
                outputf.get(2, TimeUnit.SECONDS);\r
index 6ecdc32..c00c6df 100644 (file)
@@ -27,7 +27,7 @@ import compbio.engine.Cleaner;
 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.ResultNotAvailableException;\r
 \r
@@ -56,8 +56,7 @@ public final class LocalEngineUtil {
 \r
        public static boolean cancelJob(Future<ConfiguredExecutable<?>> future,\r
                        String workDirectory) {\r
-               compbio.engine.client.Util.writeMarker(workDirectory,\r
-                               JobStatus.CANCELLED);\r
+               EngineUtil.writeMarker(workDirectory, JobStatus.CANCELLED);\r
                log.debug("Cancelling local job from work directory " + workDirectory);\r
                return future.cancel(true);\r
        }\r
@@ -80,14 +79,14 @@ public final class LocalEngineUtil {
                // job has been removed from the task list\r
                // but there may be status written to the disk\r
                String workDir = Configurator.getWorkDirectory(jobId);\r
-               if (Util.isMarked(workDir, JobStatus.FINISHED)\r
-                               || Util.isMarked(workDir, JobStatus.COLLECTED)) {\r
+               if (EngineUtil.isMarked(workDir, JobStatus.FINISHED)\r
+                               || EngineUtil.isMarked(workDir, JobStatus.COLLECTED)) {\r
                        return JobStatus.FINISHED;\r
                }\r
-               if (Util.isMarked(workDir, JobStatus.CANCELLED)) {\r
+               if (EngineUtil.isMarked(workDir, JobStatus.CANCELLED)) {\r
                        return JobStatus.CANCELLED;\r
                }\r
-               if (Util.isMarked(workDir, JobStatus.FAILED)) {\r
+               if (EngineUtil.isMarked(workDir, JobStatus.FAILED)) {\r
                        return JobStatus.FAILED;\r
                }\r
                return JobStatus.UNDEFINED;\r
@@ -112,13 +111,11 @@ public final class LocalEngineUtil {
                                                                + Configurator.getWorkDirectory(taskId)\r
                                                                + " Job id is " + taskId);\r
                        }\r
-                       compbio.engine.client.Util.writeMarker(Configurator\r
-                                       .getWorkDirectory(taskId), JobStatus.COLLECTED);\r
+                       EngineUtil.writeMarker(Configurator.getWorkDirectory(taskId), JobStatus.COLLECTED);\r
                } catch (InterruptedException e) {\r
                        // reassert threads interrupted status\r
                        Thread.currentThread().interrupt();\r
-                       compbio.engine.client.Util.writeMarker(Configurator\r
-                                       .getWorkDirectory(taskId), JobStatus.FAILED);\r
+                       EngineUtil.writeMarker(Configurator.getWorkDirectory(taskId), JobStatus.FAILED);\r
                        // Cancel the job\r
                        log.debug("Cancelling job due to Interruption");\r
                        future.cancel(true);\r
@@ -126,10 +123,8 @@ public final class LocalEngineUtil {
                        // this.cleanup(taskId);\r
                } catch (ExecutionException e) {\r
                        // this.cleanup(taskId);\r
-                       compbio.engine.client.Util.writeMarker(Configurator\r
-                                       .getWorkDirectory(taskId), JobStatus.FAILED);\r
-                       log.debug("Job execution exception: " + e.getLocalizedMessage(), e\r
-                                       .getCause());\r
+                       EngineUtil.writeMarker(Configurator     .getWorkDirectory(taskId), JobStatus.FAILED);\r
+                       log.debug("Job execution exception: " + e.getLocalizedMessage(), e.getCause());\r
                        // ExecutionException returned as thus Throwable needs unwrapping\r
                        LocalEngineUtil.launderThrowable(e.getCause());\r
                } finally {\r
similarity index 90%
rename from runner/compbio/runner/Util.java
rename to runner/compbio/runner/RunnerUtil.java
index f8d7b80..5d02a18 100644 (file)
@@ -39,13 +39,14 @@ import compbio.data.sequence.UnknownFileFormatException;
 import compbio.engine.client.ConfExecutable;\r
 import compbio.engine.client.ConfiguredExecutable;\r
 import compbio.engine.client.Executable;\r
+import compbio.engine.client.EngineUtil;\r
 import compbio.metadata.JobSubmissionException;\r
 import compbio.metadata.PresetManager;\r
 import compbio.metadata.RunnerConfig;\r
 \r
-public final class Util {\r
+public final class RunnerUtil {\r
 \r
-       public static Logger log = Logger.getLogger(Util.class);\r
+       public static Logger log = Logger.getLogger(RunnerUtil.class);\r
 \r
        public static synchronized <T> RunnerConfig<T> getSupportedOptions(\r
                        Class<? extends Executable<T>> clazz) {\r
@@ -75,7 +76,7 @@ public final class Util {
                                throws UnknownFileFormatException, IOException, FileNotFoundException, NullPointerException {\r
                assert !compbio.util.Util.isEmpty(workDirectory);\r
                assert !compbio.util.Util.isEmpty(clustFile);\r
-               File cfile = new File(compbio.engine.client.Util.getFullPath(workDirectory, clustFile));\r
+               File cfile = new File(EngineUtil.getFullPath(workDirectory, clustFile));\r
                log.trace("CLUSTAL OUTPUT FILE PATH: " + cfile.getAbsolutePath());\r
                if (!(cfile.exists() && cfile.length() > 0)) {\r
                        throw new FileNotFoundException("Result for the jobId " + workDirectory + " with file name " + clustFile + " is not found!");\r
@@ -88,8 +89,7 @@ public final class Util {
                        FileNotFoundException, NullPointerException {\r
                assert !compbio.util.Util.isEmpty(workDirectory);\r
                assert !compbio.util.Util.isEmpty(clustFile);\r
-               File cfile = new File(compbio.engine.client.Util.getFullPath(\r
-                               workDirectory, clustFile));\r
+               File cfile = new File(EngineUtil.getFullPath(workDirectory, clustFile));\r
                log.trace("Jronn OUTPUT FILE PATH: " + cfile.getAbsolutePath());\r
                if (!(cfile.exists() && cfile.length() > 0)) {\r
                        throw new FileNotFoundException("Result for the jobId " + workDirectory + " with file name " + clustFile + " is not found!");\r
@@ -131,9 +131,9 @@ public final class Util {
                assert !compbio.util.Util.isEmpty(workDirectory);\r
                assert !compbio.util.Util.isEmpty(structFile);\r
                // The stdout from RNAalifold\r
-               File sFile = new File(compbio.engine.client.Util.getFullPath( workDirectory, structFile));\r
+               File sFile = new File(EngineUtil.getFullPath( workDirectory, structFile));\r
                // Base pair probability matrix (-p option)\r
-               File aliFile = new File(compbio.engine.client.Util.getFullPath( workDirectory, "alifold.out"));\r
+               File aliFile = new File(EngineUtil.getFullPath( workDirectory, "alifold.out"));\r
                // Check that stdout file exists\r
                if(!(sFile.exists() && sFile.length() > 0)) {\r
                        throw new FileNotFoundException("Result for the jobId " + workDirectory + "with file name " + structFile + " is not found!");\r
index d34bb09..9ff6549 100644 (file)
@@ -33,6 +33,7 @@ import compbio.data.sequence.SequenceUtil;
 import compbio.engine.client.CommandBuilder;\r
 import compbio.engine.client.Executable;\r
 import compbio.engine.client.SkeletalExecutable;\r
+import compbio.engine.client.EngineUtil;\r
 import compbio.metadata.ResultNotAvailableException;\r
 \r
 /**\r
@@ -99,7 +100,7 @@ public class AACon extends SkeletalExecutable<AACon> {
                        // no further actions is necessary\r
                        return settings;\r
                }\r
-               return compbio.engine.client.Util.convertToAbsolute(settings);\r
+               return EngineUtil.convertToAbsolute(settings);\r
        }\r
 \r
        @Override\r
index 46b2e5c..b6453a7 100644 (file)
@@ -28,7 +28,7 @@ import compbio.data.sequence.UnknownFileFormatException;
 import compbio.engine.client.PipedExecutable;\r
 import compbio.engine.client.SkeletalExecutable;\r
 import compbio.metadata.ResultNotAvailableException;\r
-import compbio.runner.Util;\r
+import compbio.runner.RunnerUtil;\r
 \r
 /**\r
  * DisEMBL.py smooth_frame peak_frame join_frame fold_coils fold_hotloops\r
index a20a8d2..2cb5953 100644 (file)
@@ -28,7 +28,7 @@ import compbio.data.sequence.UnknownFileFormatException;
 import compbio.engine.client.PipedExecutable;\r
 import compbio.engine.client.SkeletalExecutable;\r
 import compbio.metadata.ResultNotAvailableException;\r
-import compbio.runner.Util;\r
+import compbio.runner.RunnerUtil;\r
 \r
 /**\r
  * ./GlobPipe.py SmoothFrame DOMjoinFrame DOMpeakFrame DISjoinFrame DISpeakFrame\r
index 55a1868..b123996 100644 (file)
@@ -35,7 +35,7 @@ import compbio.engine.client.CommandBuilder;
 import compbio.engine.client.Executable;\r
 import compbio.engine.client.SkeletalExecutable;\r
 import compbio.metadata.ResultNotAvailableException;\r
-import compbio.runner.Util;\r
+import compbio.engine.client.EngineUtil;\r
 \r
 /**\r
  * Command line\r
@@ -99,7 +99,7 @@ public class Jronn extends SkeletalExecutable<Jronn> {
                        // no further actions is necessary\r
                        return settings;\r
                }\r
-               return compbio.engine.client.Util.convertToAbsolute(settings);\r
+               return EngineUtil.convertToAbsolute(settings);\r
        }\r
 \r
        @Override\r
index da35cee..046a84a 100644 (file)
@@ -31,7 +31,7 @@ import compbio.engine.client.Executable;
 import compbio.engine.client.SkeletalExecutable;\r
 import compbio.engine.client.Executable.ExecProvider;\r
 import compbio.metadata.ResultNotAvailableException;\r
-import compbio.runner.Util;\r
+import compbio.runner.RunnerUtil;\r
 \r
 public class ClustalO extends SkeletalExecutable<ClustalO> {\r
 \r
@@ -84,7 +84,7 @@ public class ClustalO extends SkeletalExecutable<ClustalO> {
        public Alignment getResults(String workDirectory)\r
                        throws ResultNotAvailableException {\r
                try {\r
-                       return Util.readClustalFile(workDirectory, getOutput());\r
+                       return RunnerUtil.readClustalFile(workDirectory, getOutput());\r
                } catch (FileNotFoundException e) {\r
                        log.error(e.getMessage(), e.getCause());\r
                        throw new ResultNotAvailableException(e);\r
index a3bab89..2ce0d03 100644 (file)
@@ -29,7 +29,7 @@ import compbio.data.sequence.Alignment;
 import compbio.data.sequence.UnknownFileFormatException;\r
 import compbio.engine.client.SkeletalExecutable;\r
 import compbio.metadata.ResultNotAvailableException;\r
-import compbio.runner.Util;\r
+import compbio.runner.RunnerUtil;\r
 \r
 public class ClustalW extends SkeletalExecutable<ClustalW> {\r
 \r
@@ -67,7 +67,7 @@ public class ClustalW extends SkeletalExecutable<ClustalW> {
        public Alignment getResults(String workDirectory)\r
                        throws ResultNotAvailableException {\r
                try {\r
-                       return Util.readClustalFile(workDirectory, getOutput());\r
+                       return RunnerUtil.readClustalFile(workDirectory, getOutput());\r
                } catch (FileNotFoundException e) {\r
                        log.error(e.getMessage(), e.getCause());\r
                        throw new ResultNotAvailableException(e);\r
index fb5ca60..6a43d35 100644 (file)
@@ -31,7 +31,7 @@ import compbio.data.sequence.UnknownFileFormatException;
 import compbio.engine.client.PipedExecutable;\r
 import compbio.engine.client.SkeletalExecutable;\r
 import compbio.metadata.ResultNotAvailableException;\r
-import compbio.runner.Util;\r
+import compbio.runner.RunnerUtil;\r
 \r
 /**\r
  * \r
@@ -64,7 +64,7 @@ public class Mafft extends SkeletalExecutable<Mafft> implements PipedExecutable<
        public Alignment getResults(String workDirectory)\r
                        throws ResultNotAvailableException {\r
                try {\r
-                       return Util.readClustalFile(workDirectory, getOutput());\r
+                       return RunnerUtil.readClustalFile(workDirectory, getOutput());\r
                } catch (FileNotFoundException e) {\r
                        log.error(e.getMessage(), e.getCause());\r
                        throw new ResultNotAvailableException(e);\r
index 20c76ac..8576a04 100644 (file)
@@ -31,7 +31,7 @@ import compbio.data.sequence.Alignment;
 import compbio.data.sequence.UnknownFileFormatException;\r
 import compbio.engine.client.SkeletalExecutable;\r
 import compbio.metadata.ResultNotAvailableException;\r
-import compbio.runner.Util;\r
+import compbio.runner.RunnerUtil;\r
 \r
 public class Muscle extends SkeletalExecutable<Muscle> {\r
 \r
@@ -83,7 +83,7 @@ public class Muscle extends SkeletalExecutable<Muscle> {
        public Alignment getResults(String workDirectory)\r
                        throws ResultNotAvailableException {\r
                try {\r
-                       return Util.readClustalFile(workDirectory, getOutput());\r
+                       return RunnerUtil.readClustalFile(workDirectory, getOutput());\r
                } catch (FileNotFoundException e) {\r
                        log.error(e.getMessage(), e.getCause());\r
                        throw new ResultNotAvailableException(e);\r
index c4f2015..872a5f8 100644 (file)
@@ -30,7 +30,7 @@ import compbio.data.sequence.UnknownFileFormatException;
 import compbio.engine.client.PipedExecutable;\r
 import compbio.engine.client.SkeletalExecutable;\r
 import compbio.metadata.ResultNotAvailableException;\r
-import compbio.runner.Util;\r
+import compbio.runner.RunnerUtil;\r
 \r
 public class Probcons extends SkeletalExecutable<Probcons>\r
                implements\r
@@ -57,7 +57,7 @@ public class Probcons extends SkeletalExecutable<Probcons>
        public Alignment getResults(String workDirectory)\r
                        throws ResultNotAvailableException {\r
                try {\r
-                       return Util.readClustalFile(workDirectory, getOutput());\r
+                       return RunnerUtil.readClustalFile(workDirectory, getOutput());\r
                } catch (FileNotFoundException e) {\r
                        log.error(e.getMessage(), e.getCause());\r
                        throw new ResultNotAvailableException(e);\r
index 7108bec..e7f4988 100644 (file)
@@ -33,7 +33,7 @@ import compbio.engine.client.PipedExecutable;
 import compbio.engine.client.SkeletalExecutable;\r
 import compbio.engine.conf.PropertyHelperManager;\r
 import compbio.metadata.ResultNotAvailableException;\r
-import compbio.runner.Util;\r
+import compbio.runner.RunnerUtil;\r
 import compbio.util.PropertyHelper;\r
 \r
 public class Tcoffee extends SkeletalExecutable<Tcoffee>\r
@@ -81,7 +81,7 @@ public class Tcoffee extends SkeletalExecutable<Tcoffee>
        public Alignment getResults(String workDirectory)\r
                        throws ResultNotAvailableException {\r
                try {\r
-                       return Util.readClustalFile(workDirectory, getOutput());\r
+                       return RunnerUtil.readClustalFile(workDirectory, getOutput());\r
                } catch (FileNotFoundException e) {\r
                        log.error(e.getMessage(), e.getCause());\r
                        throw new ResultNotAvailableException(e);\r
index 996e7d8..c0a50fe 100644 (file)
@@ -9,7 +9,7 @@ import compbio.data.sequence.RNAStructScoreManager;
 import compbio.engine.client.PipedExecutable;\r
 import compbio.engine.client.SkeletalExecutable;\r
 import compbio.metadata.ResultNotAvailableException;\r
-import compbio.runner.Util;\r
+import compbio.runner.RunnerUtil;\r
 \r
 public class RNAalifold extends SkeletalExecutable<RNAalifold> \r
                implements PipedExecutable<RNAalifold> {\r
@@ -48,7 +48,7 @@ public class RNAalifold extends SkeletalExecutable<RNAalifold>
        public RNAStructScoreManager getResults(String workDirectory)\r
                        throws ResultNotAvailableException {\r
                try {\r
-                       return Util.readRNAStruct(workDirectory, getOutput());\r
+                       return RunnerUtil.readRNAStruct(workDirectory, getOutput());\r
                } catch (FileNotFoundException e) {\r
                        log.error(e.getMessage(), e.getCause());\r
                        throw new ResultNotAvailableException(e);\r
index 447ccd3..c8998c7 100644 (file)
@@ -34,7 +34,7 @@ import compbio.data.sequence.Alignment;
 import compbio.engine.Configurator;\r
 import compbio.engine.client.ConfiguredExecutable;\r
 import compbio.engine.client.Executable;\r
-import compbio.engine.client.Util;\r
+import compbio.engine.client.EngineUtil;\r
 import compbio.metadata.AllTestSuit;\r
 import compbio.metadata.JobExecutionException;\r
 import compbio.metadata.JobStatus;\r
@@ -77,20 +77,20 @@ public class DrmaaClusterEngineTester {
                                        status == JobStatus.PENDING || status == JobStatus.RUNNING);\r
                        JobInfo info = runner.getJobInfo();\r
 \r
-                       assertFalse(Util.isMarked(confClust.getWorkDirectory(),\r
+                       assertFalse(EngineUtil.isMarked(confClust.getWorkDirectory(),\r
                                        JobStatus.CANCELLED));\r
-                       assertFalse(Util.isMarked(confClust.getWorkDirectory(),\r
+                       assertFalse(EngineUtil.isMarked(confClust.getWorkDirectory(),\r
                                        JobStatus.STARTED));\r
-                       assertFalse(Util.isMarked(confClust.getWorkDirectory(),\r
+                       assertFalse(EngineUtil.isMarked(confClust.getWorkDirectory(),\r
                                        JobStatus.COLLECTED));\r
-                       assertTrue(Util.isMarked(confClust.getWorkDirectory(),\r
+                       assertTrue(EngineUtil.isMarked(confClust.getWorkDirectory(),\r
                                        JobStatus.FINISHED));\r
-                       assertTrue(Util.isMarked(confClust.getWorkDirectory(),\r
+                       assertTrue(EngineUtil.isMarked(confClust.getWorkDirectory(),\r
                                        JobStatus.SUBMITTED));\r
 \r
                        ConfiguredExecutable<?> confExec = runner.waitForResult();\r
                        // At this point results are marked as collected\r
-                       assertTrue(Util.isMarked(confClust.getWorkDirectory(),\r
+                       assertTrue(EngineUtil.isMarked(confClust.getWorkDirectory(),\r
                                        JobStatus.COLLECTED));\r
 \r
                        assertNotNull("JobInfo is null", info);\r
@@ -102,7 +102,7 @@ public class DrmaaClusterEngineTester {
                                String exits = sm.getExitStatus();\r
                                assertNotNull("Exit status is null", exits);\r
                                // cut 4 trailing zeros from the number\r
-                               int exitsInt = ClusterUtil.CLUSTER_STAT_IN_SEC.parse(exits)\r
+                               int exitsInt = ClusterEngineUtil.CLUSTER_STAT_IN_SEC.parse(exits)\r
                                                .intValue();\r
                                assertEquals("Exit status is not 0", 0, exitsInt);\r
                                System.out.println(sm.getAllStats());\r
@@ -162,15 +162,15 @@ public class DrmaaClusterEngineTester {
                        runner.cancelJob();\r
                        Thread.sleep(200); // give fs time to write a file\r
                        JobInfo info = runner.getJobInfo();\r
-                       assertTrue(Util.isMarked(confClust.getWorkDirectory(),\r
+                       assertTrue(EngineUtil.isMarked(confClust.getWorkDirectory(),\r
                                        JobStatus.CANCELLED));\r
-                       assertFalse(Util.isMarked(confClust.getWorkDirectory(),\r
+                       assertFalse(EngineUtil.isMarked(confClust.getWorkDirectory(),\r
                                        JobStatus.STARTED));\r
-                       assertFalse(Util.isMarked(confClust.getWorkDirectory(),\r
+                       assertFalse(EngineUtil.isMarked(confClust.getWorkDirectory(),\r
                                        JobStatus.COLLECTED));\r
-                       assertTrue(Util.isMarked(confClust.getWorkDirectory(),\r
+                       assertTrue(EngineUtil.isMarked(confClust.getWorkDirectory(),\r
                                        JobStatus.FINISHED));\r
-                       assertTrue(Util.isMarked(confClust.getWorkDirectory(),\r
+                       assertTrue(EngineUtil.isMarked(confClust.getWorkDirectory(),\r
                                        JobStatus.SUBMITTED));\r
 \r
                } catch (JobSubmissionException e) {\r
index 07dcd1d..d8bf470 100644 (file)
@@ -26,24 +26,24 @@ import java.text.ParseException;
 \r
 import org.testng.annotations.Test;\r
 \r
-import compbio.engine.cluster.drmaa.ClusterUtil;\r
+import compbio.engine.cluster.drmaa.ClusterEngineUtil;\r
 \r
 public class UtilTester {\r
 \r
        @Test\r
        public void testParser() {\r
                try {\r
-                       Number n = ClusterUtil.CLUSTER_STAT_IN_SEC.parse("11.0000");\r
+                       Number n = ClusterEngineUtil.CLUSTER_STAT_IN_SEC.parse("11.0000");\r
                        assertNotNull(n);\r
                        int t = n.intValue();\r
                        assertEquals(11, t);\r
-                       n = ClusterUtil.CLUSTER_STAT_IN_SEC.parse("11.2300");\r
+                       n = ClusterEngineUtil.CLUSTER_STAT_IN_SEC.parse("11.2300");\r
                        assertNotNull(n);\r
                        t = n.intValue();\r
                        assertEquals(11, t);\r
                        float f = n.floatValue();\r
                        assertEquals(11.23f, f);\r
-                       n = ClusterUtil.CLUSTER_STAT_IN_SEC.parse("0.0310");\r
+                       n = ClusterEngineUtil.CLUSTER_STAT_IN_SEC.parse("0.0310");\r
                        assertNotNull(n);\r
                        f = n.floatValue();\r
                        assertEquals(0.031f, f);\r
index c4cbe0e..271d0e9 100644 (file)
@@ -35,7 +35,7 @@ import compbio.engine.AsyncExecutor;
 import compbio.engine.Configurator;\r
 import compbio.engine.client.ConfiguredExecutable;\r
 import compbio.engine.client.Executable;\r
-import compbio.engine.client.Util;\r
+import compbio.engine.client.EngineUtil;\r
 import compbio.metadata.AllTestSuit;\r
 import compbio.metadata.JobStatus;\r
 import compbio.metadata.JobSubmissionException;\r
@@ -276,15 +276,15 @@ public class AsyncLocalRunnerTester {
                        Executable<?> clustalr = lr.getResults(jobId);\r
                        assertNotNull(clustalr);\r
 \r
-                       assertTrue(Util.isMarked(confClustal1.getWorkDirectory(),\r
+                       assertTrue(EngineUtil.isMarked(confClustal1.getWorkDirectory(),\r
                                        JobStatus.CANCELLED));\r
-                       assertTrue(Util.isMarked(confClustal1.getWorkDirectory(),\r
+                       assertTrue(EngineUtil.isMarked(confClustal1.getWorkDirectory(),\r
                                        JobStatus.STARTED));\r
-                       assertTrue(Util.isMarked(confClustal1.getWorkDirectory(),\r
+                       assertTrue(EngineUtil.isMarked(confClustal1.getWorkDirectory(),\r
                                        JobStatus.COLLECTED));\r
-                       assertTrue(Util.isMarked(confClustal1.getWorkDirectory(),\r
+                       assertTrue(EngineUtil.isMarked(confClustal1.getWorkDirectory(),\r
                                        JobStatus.FINISHED));\r
-                       assertFalse(Util.isMarked(confClustal1.getWorkDirectory(),\r
+                       assertFalse(EngineUtil.isMarked(confClustal1.getWorkDirectory(),\r
                                        JobStatus.SUBMITTED));\r
                } catch (JobSubmissionException e) {\r
                        e.printStackTrace();\r
@@ -322,15 +322,15 @@ public class AsyncLocalRunnerTester {
                        assertNotNull(muscler);\r
                        Alignment al1 = muscler.getResults();\r
 \r
-                       assertTrue(Util.isMarked(muscler.getWorkDirectory(),\r
+                       assertTrue(EngineUtil.isMarked(muscler.getWorkDirectory(),\r
                                        JobStatus.STARTED));\r
-                       assertTrue(Util.isMarked(muscler.getWorkDirectory(),\r
+                       assertTrue(EngineUtil.isMarked(muscler.getWorkDirectory(),\r
                                        JobStatus.COLLECTED));\r
-                       assertTrue(Util.isMarked(muscler.getWorkDirectory(),\r
+                       assertTrue(EngineUtil.isMarked(muscler.getWorkDirectory(),\r
                                        JobStatus.FINISHED));\r
-                       assertFalse(Util.isMarked(muscler.getWorkDirectory(),\r
+                       assertFalse(EngineUtil.isMarked(muscler.getWorkDirectory(),\r
                                        JobStatus.CANCELLED));\r
-                       assertFalse(Util.isMarked(muscler.getWorkDirectory(),\r
+                       assertFalse(EngineUtil.isMarked(muscler.getWorkDirectory(),\r
                                        JobStatus.SUBMITTED));\r
                        Alignment al2 = confMuscle.getResults();\r
                        assertNotNull(al1);\r
@@ -369,16 +369,16 @@ public class AsyncLocalRunnerTester {
                        as.cancelJob(jobId);\r
                        assertTrue(as.getJobStatus(jobId) == JobStatus.CANCELLED);\r
 \r
-                       assertTrue(Util.isMarked(confMuscle.getWorkDirectory(),\r
+                       assertTrue(EngineUtil.isMarked(confMuscle.getWorkDirectory(),\r
                                        JobStatus.CANCELLED));\r
                        // could be both\r
                        // assertFalse(Util.isMarked(confMuscle.getWorkDirectory(),\r
                        // Util.StatFileType.STARTED));\r
-                       assertFalse(Util.isMarked(confMuscle.getWorkDirectory(),\r
+                       assertFalse(EngineUtil.isMarked(confMuscle.getWorkDirectory(),\r
                                        JobStatus.COLLECTED));\r
-                       assertFalse(Util.isMarked(confMuscle.getWorkDirectory(),\r
+                       assertFalse(EngineUtil.isMarked(confMuscle.getWorkDirectory(),\r
                                        JobStatus.FINISHED));\r
-                       assertFalse(Util.isMarked(confMuscle.getWorkDirectory(),\r
+                       assertFalse(EngineUtil.isMarked(confMuscle.getWorkDirectory(),\r
                                        JobStatus.SUBMITTED));\r
                        // Executable<?> muscler = as.getResult(jobId);\r
                        // assertNotNull(muscler);\r
index bee74b4..13dfed0 100644 (file)
@@ -31,7 +31,7 @@ import org.testng.annotations.Test;
 import compbio.engine.Configurator;\r
 import compbio.engine.client.ConfiguredExecutable;\r
 import compbio.engine.client.Executable;\r
-import compbio.engine.client.Util;\r
+import compbio.engine.client.EngineUtil;\r
 import compbio.metadata.AllTestSuit;\r
 import compbio.metadata.JobExecutionException;\r
 import compbio.metadata.JobStatus;\r
@@ -64,15 +64,15 @@ public class LocalRunnerTester {
                        lr.cancelJob();\r
                        // This call causes CancellationException to be thrown\r
                        Executable<?> clustalr = lr.waitForResult();\r
-                       assertTrue(Util.isMarked(confClust.getWorkDirectory(),\r
+                       assertTrue(EngineUtil.isMarked(confClust.getWorkDirectory(),\r
                                        JobStatus.CANCELLED));\r
-                       assertTrue(Util.isMarked(confClust.getWorkDirectory(),\r
+                       assertTrue(EngineUtil.isMarked(confClust.getWorkDirectory(),\r
                                        JobStatus.STARTED));\r
-                       assertTrue(Util.isMarked(confClust.getWorkDirectory(),\r
+                       assertTrue(EngineUtil.isMarked(confClust.getWorkDirectory(),\r
                                        JobStatus.COLLECTED));\r
-                       assertTrue(Util.isMarked(confClust.getWorkDirectory(),\r
+                       assertTrue(EngineUtil.isMarked(confClust.getWorkDirectory(),\r
                                        JobStatus.FINISHED));\r
-                       assertFalse(Util.isMarked(confClust.getWorkDirectory(),\r
+                       assertFalse(EngineUtil.isMarked(confClust.getWorkDirectory(),\r
                                        JobStatus.SUBMITTED));\r
                } catch (JobSubmissionException e) {\r
                        e.printStackTrace();\r
index b453eb7..825de0b 100644 (file)
@@ -48,7 +48,7 @@ import compbio.engine.client.ConfExecutable;
 import compbio.engine.client.ConfiguredExecutable;\r
 import compbio.engine.client.Executable;\r
 import compbio.engine.client.RunConfiguration;\r
-import compbio.engine.cluster.drmaa.ClusterUtil;\r
+import compbio.engine.cluster.drmaa.ClusterEngineUtil;\r
 import compbio.engine.cluster.drmaa.JobRunner;\r
 import compbio.engine.cluster.drmaa.StatisticManager;\r
 import compbio.engine.local.LocalRunner;\r
@@ -62,7 +62,7 @@ import compbio.metadata.Preset;
 import compbio.metadata.PresetManager;\r
 import compbio.metadata.ResultNotAvailableException;\r
 import compbio.metadata.RunnerConfig;\r
-import compbio.runner.Util;\r
+import compbio.runner.RunnerUtil;\r
 import compbio.util.FileWatcher;\r
 import compbio.util.SysPrefs;\r
 \r
@@ -98,7 +98,7 @@ public class AAConTester {
                                String exits = sm.getExitStatus();\r
                                assertNotNull("Exit status is null", exits);\r
                                // cut 4 trailing zeros from the number\r
-                               int exitsInt = ClusterUtil.CLUSTER_STAT_IN_SEC.parse(exits).intValue();\r
+                               int exitsInt = ClusterEngineUtil.CLUSTER_STAT_IN_SEC.parse(exits).intValue();\r
                                assertEquals(0, exitsInt);\r
                                System.out.println(sm.getAllStats());\r
 \r
@@ -191,7 +191,7 @@ public class AAConTester {
        @Test(groups = {AllTestSuit.test_group_runner})\r
        public void RunLocallyWithPreset() {\r
                try {\r
-                       PresetManager<AACon> aaconPresets = Util.getPresets(AACon.class);\r
+                       PresetManager<AACon> aaconPresets = RunnerUtil.getPresets(AACon.class);\r
                        assert aaconPresets != null;\r
                        ConfiguredExecutable<AACon> confAAcon = Configurator.configureExecutable(aacon, Executable.ExecProvider.Local);\r
                        Preset<AACon> quick = aaconPresets.getPresetByName("Quick conservation");\r
index 6ea203c..de206d0 100644 (file)
@@ -51,7 +51,7 @@ import compbio.engine.client.ConfExecutable;
 import compbio.engine.client.ConfiguredExecutable;\r
 import compbio.engine.client.Executable;\r
 import compbio.engine.client.RunConfiguration;\r
-import compbio.engine.cluster.drmaa.ClusterUtil;\r
+import compbio.engine.cluster.drmaa.ClusterEngineUtil;\r
 import compbio.engine.cluster.drmaa.JobRunner;\r
 import compbio.engine.cluster.drmaa.StatisticManager;\r
 import compbio.engine.local.LocalRunner;\r
@@ -106,7 +106,7 @@ public class DisemblTester {
                                String exits = sm.getExitStatus();\r
                                assertNotNull("Exit status is null", exits);\r
                                // cut 4 trailing zeros from the number\r
-                               int exitsInt = ClusterUtil.CLUSTER_STAT_IN_SEC.parse(exits)\r
+                               int exitsInt = ClusterEngineUtil.CLUSTER_STAT_IN_SEC.parse(exits)\r
                                                .intValue();\r
                                assertEquals(0, exitsInt);\r
                                System.out.println(sm.getAllStats());\r
index b32e8d4..aef8de2 100644 (file)
@@ -49,7 +49,7 @@ import compbio.engine.client.ConfExecutable;
 import compbio.engine.client.ConfiguredExecutable;\r
 import compbio.engine.client.Executable;\r
 import compbio.engine.client.RunConfiguration;\r
-import compbio.engine.cluster.drmaa.ClusterUtil;\r
+import compbio.engine.cluster.drmaa.ClusterEngineUtil;\r
 import compbio.engine.cluster.drmaa.JobRunner;\r
 import compbio.engine.cluster.drmaa.StatisticManager;\r
 import compbio.engine.local.LocalRunner;\r
@@ -102,7 +102,7 @@ public class GlobPlotTester {
                                String exits = sm.getExitStatus();\r
                                assertNotNull("Exit status is null", exits);\r
                                // cut 4 trailing zeros from the number\r
-                               int exitsInt = ClusterUtil.CLUSTER_STAT_IN_SEC.parse(exits)\r
+                               int exitsInt = ClusterEngineUtil.CLUSTER_STAT_IN_SEC.parse(exits)\r
                                                .intValue();\r
                                assertEquals(0, exitsInt);\r
                                System.out.println(sm.getAllStats());\r
index 242e90e..f521154 100644 (file)
@@ -49,7 +49,7 @@ import compbio.engine.client.ConfExecutable;
 import compbio.engine.client.ConfiguredExecutable;\r
 import compbio.engine.client.Executable;\r
 import compbio.engine.client.RunConfiguration;\r
-import compbio.engine.cluster.drmaa.ClusterUtil;\r
+import compbio.engine.cluster.drmaa.ClusterEngineUtil;\r
 import compbio.engine.cluster.drmaa.JobRunner;\r
 import compbio.engine.cluster.drmaa.StatisticManager;\r
 import compbio.engine.local.LocalRunner;\r
@@ -101,7 +101,7 @@ public class IUPredTester {
                                String exits = sm.getExitStatus();\r
                                assertNotNull("Exit status is null", exits);\r
                                // cut 4 trailing zeros from the number\r
-                               int exitsInt = ClusterUtil.CLUSTER_STAT_IN_SEC.parse(exits)\r
+                               int exitsInt = ClusterEngineUtil.CLUSTER_STAT_IN_SEC.parse(exits)\r
                                                .intValue();\r
                                assertEquals(0, exitsInt);\r
                                System.out.println(sm.getAllStats());\r
index a3e0905..d0cadaa 100644 (file)
@@ -49,7 +49,7 @@ import compbio.engine.client.ConfExecutable;
 import compbio.engine.client.ConfiguredExecutable;\r
 import compbio.engine.client.Executable;\r
 import compbio.engine.client.RunConfiguration;\r
-import compbio.engine.cluster.drmaa.ClusterUtil;\r
+import compbio.engine.cluster.drmaa.ClusterEngineUtil;\r
 import compbio.engine.cluster.drmaa.JobRunner;\r
 import compbio.engine.cluster.drmaa.StatisticManager;\r
 import compbio.engine.local.LocalRunner;\r
@@ -95,7 +95,7 @@ public class JronnTester {
                                String exits = sm.getExitStatus();\r
                                assertNotNull("Exit status is null", exits);\r
                                // cut 4 trailing zeros from the number\r
-                               int exitsInt = ClusterUtil.CLUSTER_STAT_IN_SEC.parse(exits).intValue();\r
+                               int exitsInt = ClusterEngineUtil.CLUSTER_STAT_IN_SEC.parse(exits).intValue();\r
                                assertEquals(0, exitsInt);\r
                                //System.out.println(sm.getAllStats());\r
                        } catch (ParseException e) {\r
index 9712ef8..d50e0fa 100644 (file)
@@ -44,13 +44,13 @@ import compbio.engine.AsyncExecutor;
 import compbio.engine.Configurator;\r
 import compbio.engine.FilePuller;\r
 import compbio.engine.SyncExecutor;\r
-import compbio.engine.client.Util;\r
+import compbio.engine.client.EngineUtil;\r
 import compbio.engine.client.ConfExecutable;\r
 import compbio.engine.client.ConfiguredExecutable;\r
 import compbio.engine.client.Executable;\r
 import compbio.engine.client.Executable.ExecProvider;\r
 import compbio.engine.client.RunConfiguration;\r
-import compbio.engine.cluster.drmaa.ClusterUtil;\r
+import compbio.engine.cluster.drmaa.ClusterEngineUtil;\r
 import compbio.engine.cluster.drmaa.JobRunner;\r
 import compbio.engine.cluster.drmaa.StatisticManager;\r
 import compbio.engine.conf.RunnerConfigMarshaller;\r
@@ -244,7 +244,7 @@ public class ClustalOTester {
 \r
                        AsyncExecutor sexec = Configurator.getAsyncEngine(confal);\r
                        String jobId = sexec.submitJob(confal);\r
-                       String file = Util.getFullPath(confal.getWorkDirectory(), ClustalW.getStatFile());\r
+                       String file = EngineUtil.getFullPath(confal.getWorkDirectory(), ClustalW.getStatFile());\r
                        FilePuller fw = FilePuller.newFilePuller(file, FileWatcher.MIN_CHUNK_SIZE_BYTES);\r
                        int count = 0;\r
                        long position = 0;\r
@@ -302,7 +302,7 @@ public class ClustalOTester {
                                String exits = sm.getExitStatus();\r
                                assertNotNull("Exit status is null", exits);\r
                                // cut 4 trailing zeros from the number\r
-                               int exitsInt = ClusterUtil.CLUSTER_STAT_IN_SEC.parse(exits).intValue();\r
+                               int exitsInt = ClusterEngineUtil.CLUSTER_STAT_IN_SEC.parse(exits).intValue();\r
                                assertEquals(0, exitsInt);\r
                                System.out.println(sm.getAllStats());\r
                        } catch (ParseException e) {\r
@@ -336,7 +336,7 @@ public class ClustalOTester {
 \r
                        AsyncExecutor sexec = Configurator.getAsyncEngine(confClustal);\r
                        String jobId = sexec.submitJob(confClustal);\r
-                       String file = Util.getFullPath(confClustal.getWorkDirectory(), ClustalW.getStatFile());\r
+                       String file = EngineUtil.getFullPath(confClustal.getWorkDirectory(), ClustalW.getStatFile());\r
                        FilePuller fw = FilePuller.newFilePuller(file, FileWatcher.MIN_CHUNK_SIZE_BYTES);\r
                        int count = 0;\r
                        long position = 0;\r
index 44f5ec0..e6f7ac9 100644 (file)
@@ -52,7 +52,7 @@ import compbio.engine.client.ConfiguredExecutable;
 import compbio.engine.client.Executable;\r
 import compbio.engine.client.RunConfiguration;\r
 import compbio.engine.client.Executable.ExecProvider;\r
-import compbio.engine.cluster.drmaa.ClusterUtil;\r
+import compbio.engine.cluster.drmaa.ClusterEngineUtil;\r
 import compbio.engine.cluster.drmaa.JobRunner;\r
 import compbio.engine.cluster.drmaa.StatisticManager;\r
 import compbio.engine.conf.RunnerConfigMarshaller;\r
@@ -69,7 +69,7 @@ import compbio.metadata.PresetManager;
 import compbio.metadata.ResultNotAvailableException;\r
 import compbio.metadata.RunnerConfig;\r
 import compbio.runner.OptionCombinator;\r
-import compbio.runner.Util;\r
+import compbio.runner.RunnerUtil;\r
 import compbio.runner.msa.ClustalW;\r
 import compbio.util.FileWatcher;\r
 import compbio.util.SysPrefs;\r
@@ -228,7 +228,7 @@ public class ClustalWTester {
                ConfiguredExecutable<ClustalW> confClustal;\r
                try {\r
                        confClustal = Configurator.configureExecutable(cl);\r
-                       Util.writeInput(seqs, confClustal);\r
+                       RunnerUtil.writeInput(seqs, confClustal);\r
 \r
                        LocalRunner lr = new LocalRunner(confClustal);\r
                        lr.executeJob();\r
@@ -387,7 +387,7 @@ public class ClustalWTester {
                                String exits = sm.getExitStatus();\r
                                assertNotNull("Exit status is null", exits);\r
                                // cut 4 trailing zeros from the number\r
-                               int exitsInt = ClusterUtil.CLUSTER_STAT_IN_SEC.parse(exits).intValue();\r
+                               int exitsInt = ClusterEngineUtil.CLUSTER_STAT_IN_SEC.parse(exits).intValue();\r
                                assertEquals(0, exitsInt);\r
                                System.out.println(sm.getAllStats());\r
                        } catch (ParseException e) {\r
index c111121..4d85bd5 100644 (file)
@@ -294,7 +294,7 @@ public class MafftTester {
                        AsyncExecutor sexec = Configurator.getAsyncEngine(cmafft,\r
                                        ExecProvider.Local);\r
                        String jobId = sexec.submitJob(cmafft);\r
-                       FilePuller fw = FilePuller.newFilePuller(compbio.engine.client.Util\r
+                       FilePuller fw = FilePuller.newFilePuller(compbio.engine.client.EngineUtil\r
                                        .getFullPath(cmafft.getWorkDirectory(), cmafft.getError()),\r
                                        256);\r
                        int count = 0;\r
index 954cd4f..dc45ca5 100644 (file)
@@ -47,7 +47,7 @@ import compbio.engine.client.ConfExecutable;
 import compbio.engine.client.ConfiguredExecutable;\r
 import compbio.engine.client.Executable;\r
 import compbio.engine.client.RunConfiguration;\r
-import compbio.engine.cluster.drmaa.ClusterUtil;\r
+import compbio.engine.cluster.drmaa.ClusterEngineUtil;\r
 import compbio.engine.cluster.drmaa.JobRunner;\r
 import compbio.engine.cluster.drmaa.StatisticManager;\r
 import compbio.engine.local.LocalRunner;\r
@@ -104,7 +104,7 @@ public class MuscleTester {
                                String exits = sm.getExitStatus();\r
                                assertNotNull("Exit status is null", exits);\r
                                // cut 4 trailing zeros from the number\r
-                               int exitsInt = ClusterUtil.CLUSTER_STAT_IN_SEC.parse(exits)\r
+                               int exitsInt = ClusterEngineUtil.CLUSTER_STAT_IN_SEC.parse(exits)\r
                                                .intValue();\r
                                assertEquals(0, exitsInt);\r
                                System.out.println(sm.getAllStats());\r
index 361aae2..afdc1b6 100644 (file)
@@ -199,7 +199,7 @@ public class ProbconsTester {
                                        Executable.ExecProvider.Local);\r
                        AsyncExecutor sexec = Configurator.getAsyncEngine(cprobs);\r
                        String jobId = sexec.submitJob(cprobs);\r
-                       FilePuller fw = FilePuller.newFilePuller(compbio.engine.client.Util\r
+                       FilePuller fw = FilePuller.newFilePuller(compbio.engine.client.EngineUtil\r
                                        .getFullPath(cprobs.getWorkDirectory(), cprobs.getError()),\r
                                        256);\r
                        ConfiguredExecutable<?> al = sexec.getResults(jobId);\r
index 70ba1f4..9565f82 100644 (file)
@@ -61,9 +61,9 @@ public class TcoffeeParametersTester {
                log.setLevel(Level.INFO);\r
        }\r
 \r
-       RunnerConfig<Tcoffee> tcoffeeConfig = compbio.runner.Util.getSupportedOptions(Tcoffee.class);\r
+       RunnerConfig<Tcoffee> tcoffeeConfig = compbio.runner.RunnerUtil.getSupportedOptions(Tcoffee.class);\r
        OptionCombinator tcoffeeOpc = null;\r
-       PresetManager<Tcoffee> presets = compbio.runner.Util.getPresets(Tcoffee.class);\r
+       PresetManager<Tcoffee> presets = compbio.runner.RunnerUtil.getPresets(Tcoffee.class);\r
 \r
        @BeforeMethod(groups = { AllTestSuit.test_group_runner,\r
                        AllTestSuit.test_group_non_windows })\r
index b1b991f..1bf753b 100644 (file)
@@ -47,7 +47,7 @@ import compbio.engine.client.ConfExecutable;
 import compbio.engine.client.ConfiguredExecutable;\r
 import compbio.engine.client.Executable;\r
 import compbio.engine.client.RunConfiguration;\r
-import compbio.engine.cluster.drmaa.ClusterUtil;\r
+import compbio.engine.cluster.drmaa.ClusterEngineUtil;\r
 import compbio.engine.cluster.drmaa.JobRunner;\r
 import compbio.engine.cluster.drmaa.StatisticManager;\r
 import compbio.engine.local.LocalRunner;\r
@@ -61,7 +61,7 @@ import compbio.metadata.Preset;
 import compbio.metadata.PresetManager;\r
 import compbio.metadata.ResultNotAvailableException;\r
 import compbio.metadata.RunnerConfig;\r
-import compbio.runner.Util;\r
+import compbio.runner.RunnerUtil;\r
 import compbio.util.FileWatcher;\r
 import compbio.util.SysPrefs;\r
 \r
@@ -85,7 +85,7 @@ public class JpredTester {
        public void RunOnCluster() {\r
                assertFalse(SysPrefs.isWindows, "Cluster execution can only be in unix environment");\r
                try {\r
-                       PresetManager<Jpred> jpredPreset = Util.getPresets(Jpred.class);\r
+                       PresetManager<Jpred> jpredPreset = RunnerUtil.getPresets(Jpred.class);\r
                        assert jpredPreset != null;\r
                        ConfiguredExecutable<Jpred> confpred = Configurator.configureExecutable(pred, Executable.ExecProvider.Cluster);\r
                        Preset<Jpred> conf = jpredPreset.getPresetByName("cluster configuration");\r
@@ -104,7 +104,7 @@ public class JpredTester {
                                String exits = sm.getExitStatus();\r
                                assertNotNull("Exit status is null", exits);\r
                                // cut 4 trailing zeros from the number\r
-                               int exitsInt = ClusterUtil.CLUSTER_STAT_IN_SEC.parse(exits).intValue();\r
+                               int exitsInt = ClusterEngineUtil.CLUSTER_STAT_IN_SEC.parse(exits).intValue();\r
                                assertEquals(0, exitsInt);\r
                                System.out.println(sm.getAllStats());\r
                        } catch (ParseException e) {\r
@@ -194,7 +194,7 @@ public class JpredTester {
        public void RunLocallyWithPreset() {\r
                try {\r
                        ConfiguredExecutable<Jpred> confpred = Configurator.configureExecutable(pred, Executable.ExecProvider.Local);\r
-                       PresetManager<Jpred> preset = Util.getPresets(Jpred.class);\r
+                       PresetManager<Jpred> preset = RunnerUtil.getPresets(Jpred.class);\r
                        assert preset != null;\r
                        Preset<Jpred> conf = preset.getPresetByName("laptop configuration");\r
                        confpred.addParameters(conf.getOptions());\r
@@ -227,7 +227,7 @@ public class JpredTester {
                        jpred.setInput(test_input);\r
                        jpred.setOutput(test_output);\r
                        ConfiguredExecutable<Jpred> confpred = Configurator.configureExecutable(jpred, Executable.ExecProvider.Local);\r
-                       PresetManager<Jpred> preset = Util.getPresets(Jpred.class);\r
+                       PresetManager<Jpred> preset = RunnerUtil.getPresets(Jpred.class);\r
                        assert preset != null;\r
                        Preset<Jpred> conf = preset.getPresetByName("laptop configuration");\r
                        confpred.addParameters(conf.getOptions());\r
index 0249215..3f0986f 100644 (file)
@@ -34,7 +34,7 @@ import compbio.engine.client.ConfExecutable;
 import compbio.engine.client.ConfiguredExecutable;\r
 import compbio.engine.client.Executable;\r
 import compbio.engine.client.RunConfiguration;\r
-import compbio.engine.cluster.drmaa.ClusterUtil;\r
+import compbio.engine.cluster.drmaa.ClusterEngineUtil;\r
 import compbio.engine.cluster.drmaa.JobRunner;\r
 import compbio.engine.cluster.drmaa.StatisticManager;\r
 import compbio.engine.local.AsyncLocalRunner;\r
index 01b538f..c31f15d 100644 (file)
@@ -33,10 +33,14 @@ public class ServiceStatus extends HttpServlet {
        @Override\r
        protected void doGet(HttpServletRequest req, HttpServletResponse resp)\r
                        throws ServletException, IOException {\r
-\r
                StringBuffer jabawspath = req.getRequestURL();\r
                jabawspath = jabawspath.delete(jabawspath.lastIndexOf("/"), jabawspath.length());\r
                String serverPath = jabawspath.toString();\r
+               System.out.println("Testing services at " + serverPath); \r
+               System.out.println("      Context Path is " + req.getContextPath()); \r
+               System.out.println("      Request URI is " + req.getRequestURI());\r
+               System.out.println("      Servlet Path is " + req.getServletPath());\r
+               System.out.println("      Path Info is " + req.getPathInfo());\r
 \r
                List<ServiceTestResult> testResults = new ArrayList<ServiceTestResult>();\r
 \r
index 8a01122..e305fa5 100644 (file)
@@ -28,6 +28,7 @@ import javax.servlet.ServletContextListener;
 import org.apache.log4j.Logger;\r
 \r
 import compbio.engine.conf.PropertyHelperManager;\r
+import compbio.engine.client.EngineUtil;\r
 import compbio.stat.collector.ExecutionStatCollector;\r
 import compbio.stat.collector.StatDB;\r
 import compbio.util.PropertyHelper;\r
@@ -68,7 +69,7 @@ public class StatisticCollector implements ServletContextListener {
                int clusterMaxRuntime = getClusterJobTimeOut();\r
 \r
                int localMaxRuntime = getLocalJobTimeOut();\r
-               String localWorkDir = compbio.engine.client.Util.convertToAbsolute(getLocalJobDir());\r
+               String localWorkDir = EngineUtil.convertToAbsolute(getLocalJobDir());\r
 \r
                log.info("Initializing statistics collectors");\r
                executor = Executors.newScheduledThreadPool(2);\r
index edf186c..928288c 100644 (file)
@@ -28,9 +28,13 @@ import java.io.Closeable;
 import java.io.IOException;\r
 import java.io.PrintWriter;\r
 import java.net.ConnectException;\r
+import java.net.MalformedURLException;\r
+import java.net.URL;\r
 import java.util.Arrays;\r
 import java.util.List;\r
+import java.util.logging.Level;\r
 \r
+import javax.xml.ws.Service;\r
 import javax.xml.ws.WebServiceException;\r
 \r
 import compbio.data.msa.JABAService;\r
@@ -256,7 +260,7 @@ public class WSTester {
 \r
        private <T> boolean testSequenceAnnotationWS(\r
                        SequenceAnnotation<T> wservice, Services service) throws Exception {\r
-               writer.print("Calling analyse.........");\r
+               writer.print("Calling annotation test.........");\r
 \r
                List<FastaSequence> input = loadSeqs(2);\r
                if (service == Services.AAConWS ) {\r
@@ -304,8 +308,7 @@ public class WSTester {
 \r
        private void reportException(Exception e) {\r
                writer.println(FAILED);\r
-               writer.println("Exception while waiting for results. "\r
-                               + "Exception details are below:");\r
+               writer.println("Exception while waiting for results. Exception details are below:");\r
                writer.println(e.getLocalizedMessage());\r
                e.printStackTrace(writer);\r
        }\r
@@ -429,6 +432,44 @@ public class WSTester {
                }\r
 \r
        }\r
+       \r
+       /**\r
+        * Connects to a web service by the host and the service name web service type\r
+        * \r
+        * @param host\r
+        *            the fully qualified name of JABAWS server including JABAWS\r
+        *            context name e.g\r
+        *            http://nanna.cluster.lifesci.dundee.ac.uk:8080/jaba\r
+        * @param service\r
+        *            the name of the JABAWS service to connect to\r
+        * @return JABAService<T>\r
+        * @throws WebServiceException\r
+        * @throws ConnectException\r
+        *             if fails to connect to the service on the host\r
+        */\r
+       private JABAService connect(String host, Services service)\r
+                       throws WebServiceException, ConnectException {\r
+               URL url = null;\r
+               System.out.println ("Attempting to connect with " + service.toString() + "...");\r
+               try {\r
+                       url = new URL(host + "/" + service.toString() + "?wsdl");\r
+                       System.out.println ("URL: " + url.toString());\r
+               } catch (MalformedURLException e) {\r
+                       e.printStackTrace();\r
+               }\r
+               Service serv = null;\r
+               try {\r
+                       serv = service.getService(url, service.getServiceNamespace());\r
+               } catch (WebServiceException wse) {\r
+                       wse.printStackTrace();\r
+               }\r
+               if (serv == null) {\r
+                       throw new ConnectException("Could not connect to " + url + ". Is the server down?");\r
+               }\r
+               JABAService srv = service.getInterface(serv);\r
+               System.out.println ("Connected successfully!");\r
+               return srv;\r
+       }\r
 \r
        /**\r
         * Test JABA web service\r
@@ -441,7 +482,7 @@ public class WSTester {
         */\r
        public boolean checkService(Services service) throws ConnectException,\r
                        WebServiceException {\r
-               JABAService ws = Jws2Client.connect(hostname, service);\r
+               JABAService ws = connect(hostname, service);\r
                if (ws == null) {\r
                        String line = "Cannot estabilish the connection to host " + hostname + " with service ";\r
                        writer.println(line + service.toString());\r
index 2681364..1d8e9b6 100644 (file)
@@ -35,6 +35,7 @@ import compbio.engine.Configurator;
 import compbio.engine.client.ConfiguredExecutable;\r
 import compbio.engine.client.Executable;\r
 import compbio.engine.client.SkeletalExecutable;\r
+import compbio.engine.client.EngineUtil;\r
 import compbio.metadata.ChunkHolder;\r
 import compbio.metadata.JobStatus;\r
 import compbio.metadata.JobSubmissionException;\r
@@ -46,19 +47,16 @@ import compbio.metadata.PresetManager;
 import compbio.metadata.ResultNotAvailableException;\r
 import compbio.metadata.RunnerConfig;\r
 import compbio.metadata.WrongParameterException;\r
-import compbio.runner.Util;\r
+import compbio.runner.RunnerUtil;\r
 import compbio.runner.msa.ClustalO;\r
 \r
 @WebService(endpointInterface = "compbio.data.msa.MsaWS", targetNamespace = JABAService.SERVICE_NAMESPACE, serviceName = "ClustalOWS")\r
 public class ClustalOWS implements MsaWS<ClustalO> {\r
 \r
        private static Logger log = Logger.getLogger(ClustalOWS.class);\r
-\r
-       private static final RunnerConfig<ClustalO> clustalOptions = Util.getSupportedOptions(ClustalO.class);\r
-\r
-       private static final PresetManager<ClustalO> clustalPresets = Util.getPresets(ClustalO.class);\r
-\r
-       private static final LimitsManager<ClustalO> limitMan = compbio.engine.client.Util.getLimits(new ClustalO().getType());\r
+       private static final RunnerConfig<ClustalO> clustalOptions = RunnerUtil.getSupportedOptions(ClustalO.class);\r
+       private static final PresetManager<ClustalO> clustalPresets = RunnerUtil.getPresets(ClustalO.class);\r
+       private static final LimitsManager<ClustalO> limitMan = EngineUtil.getLimits(new ClustalO().getType());\r
 \r
        @Override\r
        public String align(List<FastaSequence> sequences)\r
index ce12c6a..9799bd7 100644 (file)
@@ -34,6 +34,7 @@ import compbio.engine.AsyncExecutor;
 import compbio.engine.Configurator;\r
 import compbio.engine.client.ConfiguredExecutable;\r
 import compbio.engine.client.SkeletalExecutable;\r
+import compbio.engine.client.EngineUtil;\r
 import compbio.metadata.ChunkHolder;\r
 import compbio.metadata.JobStatus;\r
 import compbio.metadata.JobSubmissionException;\r
@@ -45,19 +46,16 @@ import compbio.metadata.PresetManager;
 import compbio.metadata.ResultNotAvailableException;\r
 import compbio.metadata.RunnerConfig;\r
 import compbio.metadata.WrongParameterException;\r
-import compbio.runner.Util;\r
+import compbio.runner.RunnerUtil;\r
 import compbio.runner.msa.ClustalW;\r
 \r
 @WebService(endpointInterface = "compbio.data.msa.MsaWS", targetNamespace = JABAService.SERVICE_NAMESPACE, serviceName = "ClustalWS")\r
 public class ClustalWS implements MsaWS<ClustalW> {\r
 \r
        private static Logger log = Logger.getLogger(ClustalWS.class);\r
-\r
-       private static final RunnerConfig<ClustalW> clustalOptions = Util.getSupportedOptions(ClustalW.class);\r
-\r
-       private static final PresetManager<ClustalW> clustalPresets = Util.getPresets(ClustalW.class);\r
-\r
-       private static final LimitsManager<ClustalW> limitMan = compbio.engine.client.Util.getLimits(new ClustalW().getType());\r
+       private static final RunnerConfig<ClustalW> clustalOptions = RunnerUtil.getSupportedOptions(ClustalW.class);\r
+       private static final PresetManager<ClustalW> clustalPresets = RunnerUtil.getPresets(ClustalW.class);\r
+       private static final LimitsManager<ClustalW> limitMan = EngineUtil.getLimits(new ClustalW().getType());\r
 \r
        @Override\r
        public String align(List<FastaSequence> sequences)\r
index 53acc88..3bec5c7 100644 (file)
@@ -24,8 +24,7 @@ public class GAUtils {
        // compbio.dundee.ac.uk GA tracker\r
        private static AnalyticsConfigData config = new AnalyticsConfigData("UA-5356328-1");\r
 \r
-       private static GoogleAnalyticsTracker TRACKER = new GoogleAnalyticsTracker(\r
-                       config);\r
+       private static GoogleAnalyticsTracker TRACKER = new GoogleAnalyticsTracker(config);\r
 \r
        static final boolean IS_GA_ENABLED = isGoogleAnalyticsEnabled();\r
 \r
@@ -73,9 +72,19 @@ public class GAUtils {
                } else {\r
                        service_name = service.toString();\r
                }\r
-               TRACKER.trackPageViewFromReferrer("JABAWS/2.0/" + service_name,\r
-                               service_name, "http://www.compbio.dundee.ac.uk",\r
-                               SERVER_ADDRESS, VERSION_TYPE);\r
+               TRACKER.trackPageViewFromReferrer("JABAWS/2.0/" + service_name, service_name, "http://www.compbio.dundee.ac.uk", SERVER_ADDRESS, VERSION_TYPE);\r
                TRACKER.resetSession();\r
        }\r
+\r
+       static void reportUsage(Services service,  String CLIENT_ADDRESS) {\r
+               String service_name = "UNKNOWN";\r
+               if (service == null) {\r
+                       log.warn("GA: Services was NULL!");\r
+               } else {\r
+                       service_name = service.toString();\r
+               }\r
+               TRACKER.trackPageViewFromReferrer("JABAWS/2.0/" + service_name, service_name, "http://www.compbio.dundee.ac.uk", CLIENT_ADDRESS, VERSION_TYPE);\r
+               TRACKER.resetSession();\r
+       }\r
+\r
 }\r
index 4defd89..0b12fc4 100644 (file)
@@ -26,6 +26,7 @@ import compbio.engine.Configurator;
 import compbio.engine.client.ConfiguredExecutable;\r
 import compbio.engine.client.Executable;\r
 import compbio.engine.client.SkeletalExecutable;\r
+import compbio.engine.client.EngineUtil;\r
 import compbio.metadata.ChunkHolder;\r
 import compbio.metadata.JobStatus;\r
 import compbio.metadata.JobSubmissionException;\r
@@ -33,7 +34,7 @@ import compbio.metadata.Limit;
 import compbio.metadata.LimitsManager;\r
 import compbio.metadata.PresetManager;\r
 import compbio.metadata.RunnerConfig;\r
-import compbio.runner.Util;\r
+import compbio.runner.RunnerUtil;\r
 \r
 public abstract class GenericMetadataService<T> {\r
 \r
@@ -52,9 +53,9 @@ public abstract class GenericMetadataService<T> {
                assert exec != null;\r
                this.log = log;\r
                this.exec = exec;\r
-               this.limitMan = compbio.engine.client.Util.getLimits(exec.getType());\r
-               this.aaconOptions = Util.getSupportedOptions((Class<? extends Executable<T>>) exec.getType());\r
-               this.aaconPresets = Util.getPresets((Class<? extends Executable<T>>) exec.getType());\r
+               this.limitMan = EngineUtil.getLimits(exec.getType());\r
+               this.aaconOptions = RunnerUtil.getSupportedOptions((Class<? extends Executable<T>>) exec.getType());\r
+               this.aaconPresets = RunnerUtil.getPresets((Class<? extends Executable<T>>) exec.getType());\r
        }\r
 \r
        ConfiguredExecutable<T> init(List<FastaSequence> sequences)\r
index 18be1b8..6eb20e7 100644 (file)
@@ -35,6 +35,7 @@ import compbio.engine.Configurator;
 import compbio.engine.client.ConfiguredExecutable;\r
 import compbio.engine.client.Executable;\r
 import compbio.engine.client.SkeletalExecutable;\r
+import compbio.engine.client.EngineUtil;\r
 import compbio.metadata.ChunkHolder;\r
 import compbio.metadata.JobStatus;\r
 import compbio.metadata.JobSubmissionException;\r
@@ -46,7 +47,7 @@ import compbio.metadata.PresetManager;
 import compbio.metadata.ResultNotAvailableException;\r
 import compbio.metadata.RunnerConfig;\r
 import compbio.metadata.WrongParameterException;\r
-import compbio.runner.Util;\r
+import compbio.runner.RunnerUtil;\r
 import compbio.runner.predictors.Jpred;\r
 \r
 @WebService(endpointInterface = "compbio.data.msa.MsaWS", targetNamespace = JABAService.SERVICE_NAMESPACE, serviceName = "JpredWS")\r
@@ -54,9 +55,9 @@ public class JpredWS implements MsaWS<Jpred> {
 \r
        private static Logger log = Logger.getLogger(JpredWS.class);\r
 \r
-       private static final RunnerConfig<Jpred> jpredOptions = Util.getSupportedOptions(Jpred.class);\r
-       private static final PresetManager<Jpred> jpredPresets = Util.getPresets(Jpred.class);\r
-       private static final LimitsManager<Jpred> limitMan = compbio.engine.client.Util.getLimits(new Jpred().getType());\r
+       private static final RunnerConfig<Jpred> jpredOptions = RunnerUtil.getSupportedOptions(Jpred.class);\r
+       private static final PresetManager<Jpred> jpredPresets = RunnerUtil.getPresets(Jpred.class);\r
+       private static final LimitsManager<Jpred> limitMan = EngineUtil.getLimits(new Jpred().getType());\r
 \r
        @Override\r
        public String align(List<FastaSequence> sequences)\r
index 5ee6872..1d02e81 100644 (file)
@@ -34,6 +34,7 @@ import compbio.engine.AsyncExecutor;
 import compbio.engine.Configurator;\r
 import compbio.engine.client.ConfiguredExecutable;\r
 import compbio.engine.client.SkeletalExecutable;\r
+import compbio.engine.client.EngineUtil;\r
 import compbio.metadata.ChunkHolder;\r
 import compbio.metadata.JobStatus;\r
 import compbio.metadata.JobSubmissionException;\r
@@ -45,22 +46,16 @@ import compbio.metadata.PresetManager;
 import compbio.metadata.ResultNotAvailableException;\r
 import compbio.metadata.RunnerConfig;\r
 import compbio.metadata.WrongParameterException;\r
-import compbio.runner.Util;\r
+import compbio.runner.RunnerUtil;\r
 import compbio.runner.msa.Mafft;\r
 \r
 @WebService(endpointInterface = "compbio.data.msa.MsaWS", targetNamespace = JABAService.SERVICE_NAMESPACE, serviceName = "MafftWS")\r
 public class MafftWS implements MsaWS<Mafft> {\r
 \r
        private static Logger log = Logger.getLogger(MafftWS.class);\r
-\r
-       private static final RunnerConfig<Mafft> mafftOptions = Util\r
-                       .getSupportedOptions(Mafft.class);\r
-\r
-       private static final PresetManager<Mafft> mafftPresets = Util\r
-                       .getPresets(Mafft.class);\r
-\r
-       private static final LimitsManager<Mafft> limitMan = compbio.engine.client.Util\r
-                       .getLimits(new Mafft().getType());\r
+       private static final RunnerConfig<Mafft> mafftOptions = RunnerUtil.getSupportedOptions(Mafft.class);\r
+       private static final PresetManager<Mafft> mafftPresets = RunnerUtil.getPresets(Mafft.class);\r
+       private static final LimitsManager<Mafft> limitMan = EngineUtil.getLimits(new Mafft().getType());\r
 \r
        @Override\r
        public String align(List<FastaSequence> sequences)\r
index 632ceeb..63267c7 100644 (file)
@@ -32,6 +32,7 @@ import compbio.stat.collector.StatDB;
 import compbio.engine.conf.PropertyHelperManager;\r
 import compbio.engine.local.ExecutableWrapper;\r
 import compbio.engine.local.LocalExecutorService;\r
+import compbio.engine.client.EngineUtil;\r
 import compbio.util.PropertyHelper;\r
 \r
 /**\r
@@ -97,7 +98,7 @@ public class MainManager implements ServletContextListener {
                }\r
 \r
                // configure local cleaner\r
-               String localWorkDir = compbio.engine.client.Util.convertToAbsolute(getLocalJobDir());\r
+               String localWorkDir = EngineUtil.convertToAbsolute(getLocalJobDir());\r
                int localDirLiveSpan = PropertyHelperManager.getIntProperty(ph.getProperty("local.jobdir.maxlifespan"));\r
                int localCleaningRate = PropertyHelperManager.getIntProperty(ph.getProperty("local.jobdir.cleaning.frequency"));\r
                boolean cleanLocalDir = PropertyHelperManager.getBooleanProperty(ph.getProperty("local.stat.collector.enable"));\r
index 1937a68..943b3c2 100644 (file)
@@ -34,6 +34,7 @@ import compbio.engine.AsyncExecutor;
 import compbio.engine.Configurator;\r
 import compbio.engine.client.ConfiguredExecutable;\r
 import compbio.engine.client.SkeletalExecutable;\r
+import compbio.engine.client.EngineUtil;\r
 import compbio.metadata.ChunkHolder;\r
 import compbio.metadata.JobStatus;\r
 import compbio.metadata.JobSubmissionException;\r
@@ -45,22 +46,16 @@ import compbio.metadata.PresetManager;
 import compbio.metadata.ResultNotAvailableException;\r
 import compbio.metadata.RunnerConfig;\r
 import compbio.metadata.WrongParameterException;\r
-import compbio.runner.Util;\r
+import compbio.runner.RunnerUtil;\r
 import compbio.runner.msa.Muscle;\r
 \r
 @WebService(endpointInterface = "compbio.data.msa.MsaWS", targetNamespace = JABAService.SERVICE_NAMESPACE, serviceName = "MuscleWS")\r
 public class MuscleWS implements MsaWS<Muscle> {\r
 \r
        private static Logger log = Logger.getLogger(MuscleWS.class);\r
-\r
-       private static final RunnerConfig<Muscle> muscleOptions = Util\r
-                       .getSupportedOptions(Muscle.class);\r
-\r
-       private static final PresetManager<Muscle> musclePresets = Util\r
-                       .getPresets(Muscle.class);\r
-\r
-       private static final LimitsManager<Muscle> limitMan = compbio.engine.client.Util\r
-                       .getLimits(new Muscle().getType());\r
+       private static final RunnerConfig<Muscle> muscleOptions = RunnerUtil.getSupportedOptions(Muscle.class);\r
+       private static final PresetManager<Muscle> musclePresets = RunnerUtil.getPresets(Muscle.class);\r
+       private static final LimitsManager<Muscle> limitMan = EngineUtil.getLimits(new Muscle().getType());\r
 \r
        @Override\r
        public String align(List<FastaSequence> sequences)\r
@@ -91,8 +86,7 @@ public class MuscleWS implements MsaWS<Muscle> {
                List<String> params = WSUtil.getCommands(options,\r
                                Muscle.KEY_VALUE_SEPARATOR);\r
                confMuscle.addParameters(params);\r
-               return WSUtil.align(sequences, confMuscle, log, "customAlign",\r
-                               getLimit(""));\r
+               return WSUtil.align(sequences, confMuscle, log, "customAlign", getLimit(""));\r
        }\r
 \r
        @Override\r
index 087afc6..b688e14 100644 (file)
@@ -34,6 +34,7 @@ import compbio.engine.AsyncExecutor;
 import compbio.engine.Configurator;\r
 import compbio.engine.client.ConfiguredExecutable;\r
 import compbio.engine.client.SkeletalExecutable;\r
+import compbio.engine.client.EngineUtil;\r
 import compbio.metadata.ChunkHolder;\r
 import compbio.metadata.JobStatus;\r
 import compbio.metadata.JobSubmissionException;\r
@@ -45,7 +46,7 @@ import compbio.metadata.PresetManager;
 import compbio.metadata.ResultNotAvailableException;\r
 import compbio.metadata.RunnerConfig;\r
 import compbio.metadata.WrongParameterException;\r
-import compbio.runner.Util;\r
+import compbio.runner.RunnerUtil;\r
 import compbio.runner.msa.Probcons;\r
 \r
 @WebService(endpointInterface = "compbio.data.msa.MsaWS", targetNamespace = JABAService.SERVICE_NAMESPACE, serviceName = "ProbconsWS")\r
@@ -53,8 +54,8 @@ public class ProbconsWS implements MsaWS<Probcons> {
 \r
        private static Logger log = Logger.getLogger(ProbconsWS.class);\r
 \r
-       private static final RunnerConfig<Probcons> probconsOptions = Util.getSupportedOptions(Probcons.class);\r
-       private static final LimitsManager<Probcons> limitMan = compbio.engine.client.Util.getLimits(new Probcons().getType());\r
+       private static final RunnerConfig<Probcons> probconsOptions = RunnerUtil.getSupportedOptions(Probcons.class);\r
+       private static final LimitsManager<Probcons> limitMan = EngineUtil.getLimits(new Probcons().getType());\r
 \r
        @Override\r
        public String align(List<FastaSequence> sequences)\r
index a04e547..dec7368 100644 (file)
@@ -9,7 +9,7 @@ import javax.servlet.ServletContextListener;
 import org.apache.log4j.Logger;\r
 \r
 import compbio.engine.client.Executable.ExecProvider;\r
-import compbio.engine.client.Util;\r
+import compbio.engine.client.EngineUtil;\r
 import compbio.engine.conf.PropertyHelperManager;\r
 import compbio.runner.disorder.IUPred;\r
 import compbio.runner.msa.Muscle;\r
@@ -42,9 +42,9 @@ public class SetExecutableFlag implements ServletContextListener {
                // Assume at least one of these is configured\r
                // Do not even bother with cluster execution, sysadmins set the flag\r
                // themselves\r
-               String command = Util.getCommand(ExecProvider.Local, Muscle.class);\r
+               String command = EngineUtil.getCommand(ExecProvider.Local, Muscle.class);\r
                if (compbio.util.Util.isEmpty(command)) {\r
-                       command = Util.getCommand(ExecProvider.Local, IUPred.class);\r
+                       command = EngineUtil.getCommand(ExecProvider.Local, IUPred.class);\r
                }\r
                boolean isExec = true;\r
                if (!compbio.util.Util.isEmpty(command)) {\r
index 72291dc..ee1c1c6 100644 (file)
@@ -35,6 +35,7 @@ import compbio.engine.Configurator;
 import compbio.engine.client.ConfiguredExecutable;\r
 import compbio.engine.client.Executable;\r
 import compbio.engine.client.SkeletalExecutable;\r
+import compbio.engine.client.EngineUtil;\r
 import compbio.metadata.ChunkHolder;\r
 import compbio.metadata.JobStatus;\r
 import compbio.metadata.JobSubmissionException;\r
@@ -46,19 +47,16 @@ import compbio.metadata.PresetManager;
 import compbio.metadata.ResultNotAvailableException;\r
 import compbio.metadata.RunnerConfig;\r
 import compbio.metadata.WrongParameterException;\r
-import compbio.runner.Util;\r
+import compbio.runner.RunnerUtil;\r
 import compbio.runner.msa.Tcoffee;\r
 \r
 @WebService(endpointInterface = "compbio.data.msa.MsaWS", targetNamespace = JABAService.SERVICE_NAMESPACE, serviceName = "TcoffeeWS")\r
 public class TcoffeeWS implements MsaWS<Tcoffee> {\r
 \r
        private static Logger log = Logger.getLogger(TcoffeeWS.class);\r
-\r
-       private static final RunnerConfig<Tcoffee> tcoffeeOptions = Util.getSupportedOptions(Tcoffee.class);\r
-\r
-       private static final PresetManager<Tcoffee> tcoffeePresets = Util.getPresets(Tcoffee.class);\r
-\r
-       private static final LimitsManager<Tcoffee> limitMan = compbio.engine.client.Util.getLimits(new Tcoffee().getType());\r
+       private static final RunnerConfig<Tcoffee> tcoffeeOptions = RunnerUtil.getSupportedOptions(Tcoffee.class);\r
+       private static final PresetManager<Tcoffee> tcoffeePresets = RunnerUtil.getPresets(Tcoffee.class);\r
+       private static final LimitsManager<Tcoffee> limitMan = EngineUtil.getLimits(new Tcoffee().getType());\r
 \r
        @Override\r
        public String align(List<FastaSequence> sequences)\r
index d0c9226..835b553 100644 (file)
@@ -31,6 +31,7 @@ import compbio.engine.AsyncExecutor;
 import compbio.engine.Configurator;\r
 import compbio.engine.ProgressGetter;\r
 import compbio.engine.client.ConfiguredExecutable;\r
+import compbio.engine.client.EngineUtil;\r
 import compbio.metadata.ChunkHolder;\r
 import compbio.metadata.JobStatus;\r
 import compbio.metadata.JobSubmissionException;\r
@@ -45,31 +46,25 @@ public final class WSUtil {
 \r
        public static final void validateJobId(String jobId)\r
                        throws InvalidParameterException {\r
-               if (!compbio.engine.client.Util.isValidJobId(jobId)) {\r
-                       throw new InvalidParameterException(\r
-                                       "JobId is not provided or cannot be recognised! Given value: "\r
-                                                       + jobId);\r
+               if (!EngineUtil.isValidJobId(jobId)) {\r
+                       throw new InvalidParameterException("JobId is not provided or cannot be recognised! Given value: " + jobId);\r
                }\r
        }\r
 \r
        public static final void validateFastaInput(List<FastaSequence> sequences)\r
                        throws JobSubmissionException {\r
                if (sequences == null || sequences.isEmpty()) {\r
-                       throw new JobSubmissionException(\r
-                                       "List of fasta sequences required but not provided! ");\r
+                       throw new JobSubmissionException("List of fasta sequences required but not provided! ");\r
                }\r
                Set<String> names = new HashSet<String>();\r
                for (FastaSequence fs : sequences) {\r
                        boolean unique = names.add(fs.getId());\r
                        if (!unique) {\r
                                throw new JobSubmissionException(\r
-                                               "Input sequences must have unique names! \n"\r
-                                                               + "Sequence " + fs.getId() + " is a duplicate!");\r
+                                               "Input sequences must have unique names! \nSequence " + fs.getId() + " is a duplicate!");\r
                        }\r
                        if (fs.getLength() == 0) {\r
-                               throw new JobSubmissionException(\r
-                                               "Sequence must not be empty! Sequence: " + fs.getId()\r
-                                                               + " was empty");\r
+                               throw new JobSubmissionException("Sequence must not be empty! Sequence: " + fs.getId() + " was empty");\r
                        }\r
                }\r
        }\r
@@ -105,7 +100,7 @@ public final class WSUtil {
                if (limit != null && limit.isExceeded(sequences)) {\r
                        throw LimitExceededException.newLimitExceeded(limit, sequences);\r
                }\r
-               compbio.runner.Util.writeInput(sequences, confExec);\r
+               compbio.runner.RunnerUtil.writeInput(sequences, confExec);\r
                AsyncExecutor engine = Configurator.getAsyncEngine(confExec);\r
                String jobId = engine.submitJob(confExec);\r
                reportUsage(confExec, logger);\r
@@ -127,7 +122,7 @@ public final class WSUtil {
                if (limit != null && limit.isExceeded(sequences)) {\r
                        throw LimitExceededException.newLimitExceeded(limit, sequences);\r
                }\r
-               compbio.runner.Util.writeInput(sequences, confExec);\r
+               compbio.runner.RunnerUtil.writeInput(sequences, confExec);\r
                AsyncExecutor engine = Configurator.getAsyncEngine(confExec);\r
                String jobId = engine.submitJob(confExec);\r
                reportUsage(confExec, log);\r
@@ -144,7 +139,7 @@ public final class WSUtil {
                if (limit != null && limit.isExceeded(sequences)) {\r
                        throw LimitExceededException.newLimitExceeded(limit, sequences);\r
                }\r
-               compbio.runner.Util.writeClustalInput(sequences, confExec, '-');\r
+               compbio.runner.RunnerUtil.writeClustalInput(sequences, confExec, '-');\r
                AsyncExecutor engine = Configurator.getAsyncEngine(confExec);\r
                String jobId = engine.submitJob(confExec);\r
                reportUsage(confExec, log);\r