igpp.util
Class ThreadedReader

java.lang.Object
  extended by java.lang.Thread
      extended by igpp.util.ThreadedReader
All Implemented Interfaces:
Runnable

public class ThreadedReader
extends Thread

Collects output from a thread and stores it in interanl buffers. Collects output from both the standard out (System.out) and and standard error (System.err) of an application.

Author:
Todd King

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ThreadedReader(BufferedReader reader, ArrayList<String> out)
          Create an instance of a ThreadedReader attached to a buffered reader and place all content in an String ArrayList.
 
Method Summary
 void run()
          Do the thread's work.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, 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
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ThreadedReader

public ThreadedReader(BufferedReader reader,
                      ArrayList<String> out)
Create an instance of a ThreadedReader attached to a buffered reader and place all content in an String ArrayList.

Parameters:
reader - either standard err or standard in
out - to store the output
Method Detail

run

public void run()
Do the thread's work. Reader from the defined source and save the acquired content in the defined buffer.

Specified by:
run in interface Runnable
Overrides:
run in class Thread


Copyright © 2008-2009 Regents University of California. All Rights Reserved.