Class AbstractProcessReader
java.lang.Object
com.github.fracpete.processoutput4j.core.AbstractProcessRunnable
com.github.fracpete.processoutput4j.reader.AbstractProcessReader
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
CollectingProcessReader,ConsoleOutputProcessReader,StreamingProcessReader
Ancestor for readers that read line from stdout/stderr of the provided
Process object.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BufferedReaderthe reader use internally.protected booleanwhether to use stdout or stderr.Fields inherited from class com.github.fracpete.processoutput4j.core.AbstractProcessRunnable
m_Process, m_Queue, m_Stopped -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class com.github.fracpete.processoutput4j.core.AbstractProcessRunnable
getProcess, isStopped, logError, logError, run, setProcess, stopExecution
-
Field Details
-
m_Stdout
protected boolean m_Stdoutwhether to use stdout or stderr. -
m_Reader
the reader use internally.
-
-
Constructor Details
-
AbstractProcessReader
public AbstractProcessReader(boolean stdout) Initializes the reader.- Parameters:
stdout- whether to read stdout or stderr
-
-
Method Details
-
isStdout
public boolean isStdout()Returns whether the reader is for stdout or stderr.- Returns:
- true if for stdout
-
process
For processing the line read from stdout/stderr.- Parameters:
line- the output line
-
flush
public void flush()Flushes the data. -
doRun
protected void doRun()The actual processing loop.- Specified by:
doRunin classAbstractProcessRunnable
-