Get rind of NativeClusterJob interface as pretty much every jobs best to use some...
[jabaws.git] / engine / compbio / engine / cluster / drmaa / JobRunner.java
index e7ec791..a3f002a 100644 (file)
@@ -34,7 +34,7 @@ import compbio.engine.Cleaner;
 import compbio.engine.ClusterJobId;\r
 import compbio.engine.Configurator;\r
 import compbio.engine.SyncExecutor;\r
-import compbio.engine.client.ClusterNativeSpecExecutable;\r
+\r
 import compbio.engine.client.ConfiguredExecutable;\r
 import compbio.engine.client.Executable;\r
 import compbio.engine.client.PathValidator;\r
@@ -108,9 +108,8 @@ public class JobRunner implements SyncExecutor {
                         * If executable require special cluster configuration parameters to\r
                         * be set e.g. queue, ram, time etc\r
                         */\r
-                       if (confExec.getExecutable() instanceof ClusterNativeSpecExecutable<?>) {\r
-                               setNativeSpecs(confExec.getExecutable());\r
-                       }\r
+                       setNativeSpecs(confExec.getExecutable());\r
+\r
 \r
                        log.trace("using arguments: " + jobtempl.getArgs());\r
                        this.confExecutable = confExec;\r
@@ -161,9 +160,11 @@ public class JobRunner implements SyncExecutor {
        }\r
 \r
        void setNativeSpecs(Executable<?> executable) throws DrmaaException {\r
-               jobtempl\r
-                               .setNativeSpecification(((ClusterNativeSpecExecutable<?>) executable)\r
-                                               .getNativeSpecs());\r
+               String nativeSpecs = executable.getClusterJobSettings(); \r
+               if(!compbio.util.Util.isEmpty(nativeSpecs)) {\r
+                       log.debug("Using cluster job settings: " + nativeSpecs);\r
+                       jobtempl.setNativeSpecification(nativeSpecs);\r
+               }\r
        }\r
 \r
        void setEmail(String email) {\r