wt.util
Class ProcessLauncher.PrintStreamSpewer

java.lang.Object
  extended byjava.lang.Thread
      extended bywt.util.ProcessLauncher.PrintStreamSpewer
All Implemented Interfaces:
Runnable
Enclosing class:
ProcessLauncher

private class ProcessLauncher.PrintStreamSpewer
extends Thread

Thread to read from an input stream (line-by-line) and print it to a print stream until the input stream closes.


Field Summary
private  long inactivityTimeout_
           
private  InputStream inputStream_
           
private  long overallStopTime_
           
private  PrintWriter writer_
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
(package private) ProcessLauncher.PrintStreamSpewer(InputStream input_stream, PrintStream print_stream)
          Create the instance that reads from the specified InputStream and writes to the provided PrintStream.
(package private) ProcessLauncher.PrintStreamSpewer(InputStream input_stream, PrintWriter writer)
          Create the instance that reads from the specified InputStream and writes to the provided PrintWriter.
 
Method Summary
 void run()
          Worker component of the thread.
 void safeJoin()
          Wait for the spewer thread to complete.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

inputStream_

private final InputStream inputStream_

writer_

private final PrintWriter writer_

inactivityTimeout_

private long inactivityTimeout_

overallStopTime_

private long overallStopTime_
Constructor Detail

ProcessLauncher.PrintStreamSpewer

ProcessLauncher.PrintStreamSpewer(InputStream input_stream,
                                  PrintStream print_stream)
Create the instance that reads from the specified InputStream and writes to the provided PrintStream.

Parameters:
input_stream - The process' InputStream.
print_stream - The Output for the user.

ProcessLauncher.PrintStreamSpewer

ProcessLauncher.PrintStreamSpewer(InputStream input_stream,
                                  PrintWriter writer)
Create the instance that reads from the specified InputStream and writes to the provided PrintWriter.

Parameters:
input_stream - The process' InputStream.
writer - The Output for the user.
Method Detail

run

public void run()
Worker component of the thread.


safeJoin

public void safeJoin()
Wait for the spewer thread to complete. Will not return until the thread is complete even if the client thread is interrupted.