Always create output files, even if no output was written to them.
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@1627 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
8f9dd03e87
commit
b69eb208a6
|
|
@ -142,6 +142,8 @@ public class HierarchicalMicroScheduler extends MicroScheduler implements Hierar
|
||||||
|
|
||||||
printOnTraversalDone(result);
|
printOnTraversalDone(result);
|
||||||
|
|
||||||
|
getOutputTracker().close();
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,8 @@ public class LinearMicroScheduler extends MicroScheduler {
|
||||||
|
|
||||||
printOnTraversalDone(result);
|
printOnTraversalDone(result);
|
||||||
|
|
||||||
|
getOutputTracker().close();
|
||||||
|
|
||||||
return accumulator;
|
return accumulator;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -65,19 +65,16 @@ public abstract class OutputTracker {
|
||||||
// Otherwise, initialize them separately.
|
// Otherwise, initialize them separately.
|
||||||
if( outFileName != null && outFileName.equals(errFileName) ) {
|
if( outFileName != null && outFileName.equals(errFileName) ) {
|
||||||
outStub = errStub = new OutputStreamStub(new File(outFileName));
|
outStub = errStub = new OutputStreamStub(new File(outFileName));
|
||||||
outStub.register(this);
|
addOutput(outStub);
|
||||||
outputs.put(outStub,null);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
outStub = (outFileName != null) ? new OutputStreamStub(new File(outFileName))
|
outStub = (outFileName != null) ? new OutputStreamStub(new File(outFileName))
|
||||||
: new OutputStreamStub(System.out);
|
: new OutputStreamStub(System.out);
|
||||||
outStub.register(this);
|
addOutput(outStub);
|
||||||
outputs.put(outStub,null);
|
|
||||||
|
|
||||||
errStub = (errFileName != null) ? new OutputStreamStub(new File(errFileName))
|
errStub = (errFileName != null) ? new OutputStreamStub(new File(errFileName))
|
||||||
: new OutputStreamStub(System.err);
|
: new OutputStreamStub(System.err);
|
||||||
errStub.register(this);
|
addOutput(errStub);
|
||||||
outputs.put(errStub,null);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -127,6 +124,20 @@ public abstract class OutputTracker {
|
||||||
outputs.put(stub,null);
|
outputs.put(stub,null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Close down all existing output streams.
|
||||||
|
*/
|
||||||
|
public void close() {
|
||||||
|
for( Stub stub: outputs.keySet() ) {
|
||||||
|
// If the stream hasn't yet been created, create it so that there's at least an empty file present.
|
||||||
|
if( outputs.get(stub) == null )
|
||||||
|
getTargetStream(stub);
|
||||||
|
|
||||||
|
// Close down the storage.
|
||||||
|
outputs.get(stub).close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Collects the target stream for this data.
|
* Collects the target stream for this data.
|
||||||
* @param stub The stub for this stream.
|
* @param stub The stub for this stream.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue