Class OutputProcessStream

  • All Implemented Interfaces:
    Runnable

    public class OutputProcessStream
    extends Object
    implements Runnable
    For capturing the output of stdout or stderr of a running Process and outputting it on stdout or stderr.
    Version:
    $Revision$
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    • Field Detail

      • m_Stopped

        protected boolean m_Stopped
        whether the output was stopped.
    • Constructor Detail

      • OutputProcessStream

        public OutputProcessStream​(Process process,
                                   Class cls,
                                   boolean stdout)
        Initializes the object.
        Parameters:
        process - the process to print the output from
        cls - the class of
        stdout - if true then stdout is used, otherwise stderr
    • Method Detail

      • getPrinter

        public AbstractOutputPrinter getPrinter()
        Returns the printer instance in use.
        Returns:
        the output printer
      • run

        public void run()
        Prints the output from the process.
        Specified by:
        run in interface Runnable
      • stop

        public void stop()
        Stops the output.