Refactoring (renaming) 2 classes: AsyncJobRunner.java -> AsyncClusterRunner.java...
[jabaws.git] / engine / compbio / engine / cluster / drmaa / ClusterRunner.java
@@ -56,17 +56,17 @@ import compbio.metadata.ResultNotAvailableException;
  *       template gets deleted, this needs to be taken into account in this\r
  *       class design!\r
  */\r
-public class JobRunner implements SyncExecutor {\r
+public class ClusterRunner implements SyncExecutor {\r
 \r
        final JobTemplate jobtempl;\r
        static ClusterSession clustSession = ClusterSession.getInstance();\r
        static Session session = clustSession.getSession();\r
-       static final Logger log = Logger.getLogger(JobRunner.class);\r
+       static final Logger log = Logger.getLogger(ClusterRunner.class);\r
        final ConfiguredExecutable<?> confExecutable;\r
        private final String workDirectory;\r
        String jobId;\r
 \r
-       public JobRunner(ConfiguredExecutable<?> confExec)\r
+       public ClusterRunner(ConfiguredExecutable<?> confExec)\r
                        throws JobSubmissionException {\r
                try {\r
                        String command = confExec.getCommand(ExecProvider.Cluster);\r
@@ -84,9 +84,7 @@ public class JobRunner implements SyncExecutor {
                        // Tell the job where to get/put things\r
                        jobtempl.setWorkingDirectory(this.workDirectory);\r
 \r
-                       /*\r
-                        * Set environment variables for the process if any\r
-                        */\r
+                       // Set environment variables for the process if any\r
                        Map<String, String> jobEnv = confExec.getEnvironment();\r
                        if (jobEnv != null && !jobEnv.isEmpty()) {\r
                                setJobEnvironmentVariables(jobEnv);\r
@@ -97,20 +95,15 @@ public class JobRunner implements SyncExecutor {
                                jobtempl.setArgs(args);\r
                        }\r
 \r
-                       /*\r
-                        * If executable need in/out data to be piped into it\r
-                        */\r
+                       //If executable need in/out data to be piped into it\r
                        if (confExec.getExecutable() instanceof PipedExecutable<?>) {\r
                                setPipes(confExec);\r
                        }\r
 \r
-                       /*\r
-                        * If executable require special cluster configuration parameters to\r
-                        * be set e.g. queue, ram, time etc\r
-                        */\r
+                       // If executable require special cluster configuration parameters to\r
+                       // be set e.g. queue, ram, time etc\r
                        setNativeSpecs(confExec.getExecutable());\r
 \r
-\r
                        log.trace("using arguments: " + jobtempl.getArgs());\r
                        this.confExecutable = confExec;\r
                        // Save run configuration\r
@@ -368,7 +361,7 @@ public class JobRunner implements SyncExecutor {
        public ConfiguredExecutable<?> waitForResult() throws JobExecutionException {\r
                ConfiguredExecutable<?> confExec;\r
                try {\r
-                       confExec = new AsyncJobRunner().getResults(this.jobId);\r
+                       confExec = new AsyncClusterRunner().getResults(this.jobId);\r
                        if (confExec == null) {\r
                                log.warn("Could not find results of job " + this.jobId);\r
                        }\r
@@ -384,9 +377,9 @@ public class JobRunner implements SyncExecutor {
                return getJobStatus(this.jobId);\r
        }\r
 \r
-       public static JobRunner getInstance(ConfiguredExecutable<?> executable)\r
+       public static ClusterRunner getInstance(ConfiguredExecutable<?> executable)\r
                        throws JobSubmissionException {\r
-               return new JobRunner(executable);\r
+               return new ClusterRunner(executable);\r
        }\r
 \r
 } // class end\r