Class ConsoleOutputProcessReader
- java.lang.Object
-
- com.github.fracpete.processoutput4j.core.AbstractProcessRunnable
-
- com.github.fracpete.processoutput4j.reader.AbstractProcessReader
-
- com.github.fracpete.processoutput4j.reader.ConsoleOutputProcessReader
-
- All Implemented Interfaces:
java.lang.Runnable
public class ConsoleOutputProcessReader extends AbstractProcessReader
Just outputs the data to stdout/stderr.- Version:
- $Revision$
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Stringm_Prefixthe prefix to use.static java.lang.StringPREFIX_STDERRthe default prefix for stderr.static java.lang.StringPREFIX_STDOUTthe default prefix for stdout.-
Fields inherited from class com.github.fracpete.processoutput4j.reader.AbstractProcessReader
m_Reader, m_Stdout
-
Fields inherited from class com.github.fracpete.processoutput4j.core.AbstractProcessRunnable
m_Process, m_Queue, m_Stopped
-
-
Constructor Summary
Constructors Constructor Description ConsoleOutputProcessReader(boolean stdout)Initializes the reader.ConsoleOutputProcessReader(boolean stdout, java.lang.String prefix)Initializes the reader.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetPrefix()Returns the prefix in use.protected voidprocess(java.lang.String line)For processing the line read from stdout/stderr.-
Methods inherited from class com.github.fracpete.processoutput4j.reader.AbstractProcessReader
doRun, flush, isStdout
-
Methods inherited from class com.github.fracpete.processoutput4j.core.AbstractProcessRunnable
getProcess, isStopped, logError, logError, run, setProcess, stopExecution
-
-
-
-
Constructor Detail
-
ConsoleOutputProcessReader
public ConsoleOutputProcessReader(boolean stdout)
Initializes the reader.- Parameters:
stdout- whether to read stdout or stderr
-
ConsoleOutputProcessReader
public ConsoleOutputProcessReader(boolean stdout, java.lang.String prefix)Initializes the reader.- Parameters:
stdout- whether to read stdout or stderrprefix- the prefix to use, null for auto-prefix
-
-
Method Detail
-
getPrefix
public java.lang.String getPrefix()
Returns the prefix in use.- Returns:
- the prefix
-
process
protected void process(java.lang.String line)
For processing the line read from stdout/stderr.- Specified by:
processin classAbstractProcessReader- Parameters:
line- the output line
-
-