Package org.opends.quicksetup.util
Class OutputReader
- java.lang.Object
-
- org.opends.quicksetup.util.OutputReader
-
public abstract class OutputReader extends Object
This class is used to read an input stream and process ouput.
-
-
Constructor Summary
Constructors Constructor Description OutputReader(InputStream stream)The protected constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidprocessLine(String line)Called whenever new input is read from the reader.OutputReaderstart()Starts consuming the reader in a background thread.
-
-
-
Constructor Detail
-
OutputReader
public OutputReader(InputStream stream)
The protected constructor.The stream is consumed until end of stream and then closed by this reader's thread, which is only launched by
start(). Wrapping the stream is done by that thread as well, so that this reader is the sole owner of every resource built on top of the stream.- Parameters:
stream- the output stream of the process to read.
-
-
Method Detail
-
processLine
public abstract void processLine(String line)
Called whenever new input is read from the reader.- Parameters:
line- String representing new input
-
start
public OutputReader start()
Starts consuming the reader in a background thread.The thread is not started by the constructor so that
thisdoes not escape before construction of the subclass has completed.- Returns:
- this reader
-
-