MDACC
Biostatistics

org.mdanderson.biostat.util
Class DefaultStreamMonitor

java.lang.Object
  extended byorg.mdanderson.biostat.util.DefaultStreamMonitor
All Implemented Interfaces:
DefaultStreamMonitorKeys, Runnable
Direct Known Subclasses:
GCStreamMonitor

public class DefaultStreamMonitor
extends Object
implements Runnable, DefaultStreamMonitorKeys

DefaultStreamMonitor - Generic application stream monitoring


Field Summary
 
Fields inherited from interface org.mdanderson.biostat.util.DefaultStreamMonitorKeys
STREAMMONITOR_AWAITING_INPUT, STREAMMONITOR_DONE, STREAMMONITOR_END_OF_INPUT, STREAMMONITOR_STARTED, STREAMMONITOR_TAG
 
Constructor Summary
DefaultStreamMonitor(InputStream is, OutputStream redirect)
          Class constructor specifying input stream, and output stream
 
Method Summary
 void disableEcho()
          Disable echo of processed input from external process to 'stdout' stream.
protected  void echoOutput(String line)
          Echoes processed input from external process to 'stdout' stream.
 void enableEcho()
          Enable echo of processed input from external process to 'stdout' stream.
protected  String processLine(String line)
          Postprocesses the output from the input stream.
 void run()
          Thread entry-point for DefaultStreamMonitor object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultStreamMonitor

public DefaultStreamMonitor(InputStream is,
                            OutputStream redirect)
Class constructor specifying input stream, and output stream

Parameters:
is - input stream
redirect - output stream
Method Detail

disableEcho

public void disableEcho()
Disable echo of processed input from external process to 'stdout' stream.


enableEcho

public void enableEcho()
Enable echo of processed input from external process to 'stdout' stream.


run

public void run()
Thread entry-point for DefaultStreamMonitor object. Handles monitoring the input stream, processing what it reads and writing it to the output stream.

Specified by:
run in interface Runnable

echoOutput

protected void echoOutput(String line)
Echoes processed input from external process to 'stdout' stream. All echoed output is prefixed by tag to annotate its origin.

Parameters:
line - string containing reformatted external process output

processLine

protected String processLine(String line)
Postprocesses the output from the input stream. This implementation simply returns its argument.

Parameters:
line - string containing external process output
Returns:
string containing possibly reformatted output

MDACC
Biostatistics

Copyright © 2002 M.D. Anderson Cancer Center. All Rights Reserved.