Class AbstractProcessRunnable
java.lang.Object
com.github.fracpete.processoutput4j.core.AbstractProcessRunnable
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
AbstractProcessReader
Ancestor for runnables that use a
Process object.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voiddoRun()The actual processing loop.Returns the underlyingProcessobject.booleanReturns whether execution got stopped.protected voidJust outputs the message on stderr.protected voidJust outputs message and throwable on stderr.voidrun()Reads the data from the process.voidsetProcess(Process value) Sets the process to monitor.voidStops the execution.
-
Field Details
-
m_Queue
the blocking queue for the process. -
m_Process
the process to read from. -
m_Stopped
protected boolean m_Stoppedwhether the reader got stopped.
-
-
Constructor Details
-
AbstractProcessRunnable
public AbstractProcessRunnable()Initializes the reader.
-
-
Method Details
-
stopExecution
public void stopExecution()Stops the execution. -
isStopped
public boolean isStopped()Returns whether execution got stopped.- Returns:
- true if stopped
-
setProcess
Sets the process to monitor.- Parameters:
value- the process object
-
getProcess
Returns the underlyingProcessobject.- Returns:
- the process object, null if none set
-
logError
Just outputs the message on stderr.- Parameters:
msg- the message to output
-
logError
Just outputs message and throwable on stderr.- Parameters:
msg- the message to outputt- the exception
-
doRun
protected abstract void doRun()The actual processing loop. -
run
public void run()Reads the data from the process.
-