Changeset 906
- Timestamp:
- Dec 8, 2008, 10:01:51 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/base2/net.sf.basedb.pluginutilities/trunk/src/net/sf/basedb/plugins/AbstractRunBinaryPlugin.java
r891 r906 84 84 debug_outputfile=(System.getProperty("java.io.tmpdir") + 85 85 java.io.File.separator + debug_outputfile); 86 debug_subprocess_outputfile=(System.getProperty("java.io.tmpdir") +87 java.io.File.separator +88 debug_subprocess_outputfile);89 86 try 90 87 { … … 124 121 DbControl dc = sc.newDbControl(); 125 122 try { 126 BioAssaySet source= getSourceBioAssaySet(dc);127 int nofAssays = source .getBioAssays().list(dc).size();123 sourceBAS = getSourceBioAssaySet(dc); 124 int nofAssays = sourceBAS.getBioAssays().list(dc).size(); 128 125 if (nofAssays>10 && nofAssays<30) 129 126 execTime = Job.ExecutionTime.MEDIUM; … … 153 150 cmd[0]=getBinaryPath(this.getClass(),cmd[0]); 154 151 Process p = Runtime.getRuntime().exec(cmd, null, getExecDirectory()); 155 if ( debug_output)152 if (subprocess_stdout!=null) 156 153 { 157 154 BufferedInputStream bis=new BufferedInputStream(p.getInputStream()); 158 FileWriter fw=new FileWriter(debug_subprocess_outputfile); 155 FileWriter fw=new FileWriter(getExecDirectory() + java.io.File.separator + 156 subprocess_stdout); 159 157 int ch; 160 158 while ((ch=bis.read())>-1) fw.write(ch); … … 274 272 if (name==null) 275 273 name="New bioassay set"; 276 BioAssaySet source = getSourceBioAssaySet(dc); 274 if (sourceBAS==null) 275 sourceBAS = getSourceBioAssaySet(dc); 277 276 runBinary(); 278 277 storeResult(dc,name); … … 280 279 response.setDone("Plug-in ended successfully"); 281 280 if (debug_output) System.err.println("run succesful"); 281 response.setError("All is okay, just make sure that BASE produces error.", 282 null); 282 283 } 283 284 catch (Throwable e) { … … 301 302 } 302 303 if (debug_output) System.err.println("run end"); 303 response.setError("All is okay, just make sure that BASE produces error.",304 null);305 304 } 306 305 … … 323 322 protected Set<Permissions> permissions = new HashSet<Permissions>(); 324 323 protected Plugin.MainType plugin_maintype=null; 324 protected BioAssaySet sourceBAS = null; 325 protected String subprocess_stdout=null; 325 326 326 327 private String binaryPath=null; … … 331 332 332 333 // debug settings. Note, if debug information is on, the exec 333 // directory is not removed after plug-in execution. The file name s334 // aremodified in the constructor to contain the java temp335 // directory, i.e. debug file s arewritten into the java temp336 // directory. The file name s are (somewhat) arbitrarily chosen and337 // may overwrite existing files.338 protected Boolean debug_output= false;334 // directory is not removed after plug-in execution. The file name 335 // is modified in the constructor to contain the java temp 336 // directory, i.e. debug file is written into the java temp 337 // directory. The file name is (somewhat) arbitrarily chosen and may 338 // overwrite existing file. 339 protected Boolean debug_output=true; 339 340 private String debug_outputfile="ARBPdebug.txt"; 340 private String debug_subprocess_outputfile="ARBPdebug_subprocess.txt";341 341 }
Note: See TracChangeset
for help on using the changeset viewer.