net.codescore.exe
Class StreamWriter
java.lang.Object
java.lang.Thread
net.codescore.exe.StreamWriter
- All Implemented Interfaces:
- Runnable
public class StreamWriter
- extends Thread
This class handles a writing a process's output stream (std or err) to file
and copying it into the database for the submission. Use the Thread.start()
to begin monitoring the stream.
- Author:
- Adam Cornett
|
Method Summary |
protected void |
cleanup()
|
void |
run()
|
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
f
private final File f
file
private final StringBuilder file
in
private final InputStream in
log
private org.apache.commons.logging.Log log
mode
private final StreamWriter.OutputMode mode
s
private final Submission s
StreamWriter
public StreamWriter(File outF,
InputStream in,
Submission s,
StreamWriter.OutputMode mode)
- Parameters:
outF - The file to write the steam out toin - The input stream to read froms - The submission to work withmode - What file should be used, Compile or Execution and Standard
Error or Standard Out.
run
public void run()
- Specified by:
run in interface Runnable- Overrides:
run in class Thread
cleanup
protected void cleanup()
throws IOException
- Throws:
IOException
Copyright 2008 © Adam Cornett, Andrew Conner All Rights Reserved.