Changeset 1035
- Timestamp:
- Apr 8, 2009, 12:06:41 AM (14 years ago)
- Location:
- plugins/base2/net.sf.basedb.pluginutilities/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/base2/net.sf.basedb.pluginutilities/trunk/build.xml
r1031 r1035 45 45 <property name="javac.encoding" value="UTF-8" /> 46 46 <property name="depend.jars" 47 value="http://base2.thep.lu.se/base/jars/2. 5.0"47 value="http://base2.thep.lu.se/base/jars/2.6.0" 48 48 description="The location of the BASE core JARs that we depend on" 49 49 /> -
plugins/base2/net.sf.basedb.pluginutilities/trunk/src/net/sf/basedb/plugins/AbstractRunBinaryPlugin.java
r1022 r1035 38 38 import net.sf.basedb.core.SpotBatcher; 39 39 import net.sf.basedb.core.Transformation; 40 import net.sf.basedb.core.signal.SignalException; 41 import net.sf.basedb.core.signal.SignalHandler; 42 import net.sf.basedb.core.signal.SignalTarget; 43 import net.sf.basedb.core.signal.ThreadSignalHandler; 40 44 import net.sf.basedb.util.Values; 41 45 … … 81 85 abstract public class AbstractRunBinaryPlugin 82 86 extends AbstractAnalysisPlugin 83 implements InteractivePlugin 87 implements InteractivePlugin, SignalTarget 84 88 { 85 89 … … 151 155 throws InterruptedException, IOException 152 156 { 153 if (debug_output) System.err.println("execute"); 157 checkInterrupted(); 158 if (debug_output) 159 { 160 System.err.println("executing:"); 161 for (String s: cmd) System.err.print(" "+s); 162 System.err.println(""); 163 } 154 164 if (progress != null) progress.display(5, (about.getName() + 155 165 " waiting for external binary.")); … … 167 177 bos.close(); 168 178 } 179 BufferedInputStream bis=new BufferedInputStream(p.getInputStream()); 180 try 181 { 182 if (debug_output) System.err.println("waiting for binary to finish"); 183 p.waitFor(); 184 } 185 catch (InterruptedException se) 186 { 187 p.destroy(); 188 throw new InterruptedException("Aborted by user"); 189 } 169 190 if (subprocess_stdout!=null) 170 191 { 171 192 if (debug_output) System.err.println("reading stdout"); 172 BufferedInputStream bis=new BufferedInputStream(p.getInputStream());173 193 FileWriter fw=new FileWriter(getExecDirectory() + java.io.File.separator + 174 194 subprocess_stdout); … … 177 197 fw.close(); 178 198 } 179 p.waitFor();180 199 int status=p.exitValue(); 181 200 if (status>0) … … 293 312 294 313 314 public SignalHandler getSignalHandler() 315 { 316 signalHandler = new ThreadSignalHandler(); 317 return signalHandler; 318 } 319 320 295 321 public boolean requiresConfiguration() 296 322 { … … 302 328 { 303 329 if (debug_output) System.err.println("ARBP: run"); 330 if (signalHandler != null) signalHandler.setWorkerThread(null); 304 331 progress=_progress; 305 332 DbControl dc=sc.newDbControl(); … … 309 336 if (progress != null) progress.display(0, about.getName()); 310 337 runBinary(); 338 checkInterrupted(); 311 339 if (progress != null) progress.display(90, "Storing result"); 312 340 storeResult(dc); 341 checkInterrupted(); 313 342 if (debug_output) 314 343 { … … 400 429 private java.io.File execDirectory; 401 430 private ProgressReporter progress=null; 431 private ThreadSignalHandler signalHandler; 402 432 403 433 // debug settings. Note, if debug information is on, the exec
Note: See TracChangeset
for help on using the changeset viewer.