public final V call() throws Exception {
TimeOut timeOut = null;
try {
if (status == QStatus.CANCELLED)
throw new CancellationException();
start = new Time();
// set a timer running
// - can lead to InterruptedExceptions
if (maxTime > 0) {
timeOut = new TimeOut(maxTime);
}
// assert runner != null;
status = QStatus.RUNNING;
thread = Thread.currentThread();
// Set the thread name (but keep it short)
// This will always be reset to Done: or Error: by the end of the
// method call
thread.setName(StrUtils.ellipsize(name == null ? toString() : name,
32));
if (captureStdOut) {
sysOut = new SysOutCollectorStream();
}
// run!
output = run();
end = new Time();
status = QStatus.DONE;
thread.setName(StrUtils.ellipsize("Done: " + thread.getName(), 32));
return output;
} catch (Throwable e) {
status = QStatus.ERROR;