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:
Runnable
Just outputs the data to stdout/stderr.
- Version:
- $Revision$
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringthe prefix to use.static Stringthe default prefix for stderr.static Stringthe default prefix for stdout.Fields inherited from class com.github.fracpete.processoutput4j.reader.AbstractProcessReader
m_Reader, m_StdoutFields inherited from class com.github.fracpete.processoutput4j.core.AbstractProcessRunnable
m_Process, m_Queue, m_Stopped -
Constructor Summary
ConstructorsConstructorDescriptionConsoleOutputProcessReader(boolean stdout) Initializes the reader.ConsoleOutputProcessReader(boolean stdout, String prefix) Initializes the reader. -
Method Summary
Methods inherited from class com.github.fracpete.processoutput4j.reader.AbstractProcessReader
doRun, flush, isStdoutMethods inherited from class com.github.fracpete.processoutput4j.core.AbstractProcessRunnable
getProcess, isStopped, logError, logError, run, setProcess, stopExecution
-
Field Details
-
PREFIX_STDOUT
the default prefix for stdout. -
PREFIX_STDERR
the default prefix for stderr. -
m_Prefix
the prefix to use.
-
-
Constructor Details
-
ConsoleOutputProcessReader
public ConsoleOutputProcessReader(boolean stdout) Initializes the reader.- Parameters:
stdout- whether to read stdout or stderr
-
ConsoleOutputProcessReader
Initializes the reader.- Parameters:
stdout- whether to read stdout or stderrprefix- the prefix to use, null for auto-prefix
-
-
Method Details
-
getPrefix
Returns the prefix in use.- Returns:
- the prefix
-
process
For processing the line read from stdout/stderr.- Specified by:
processin classAbstractProcessReader- Parameters:
line- the output line
-