StreamConsumer insteadpublic class StreamHelper extends Thread
Thread.State, Thread.UncaughtExceptionHandler| Modifier and Type | Field and Description |
|---|---|
protected StringBuffer |
contentBuffer
Deprecated.
The content buffer
|
protected boolean |
keepReading
Deprecated.
True to keep reading the streams
|
protected org.slf4j.Logger |
processLogger
Deprecated.
Append messages to this logger
|
protected PrintWriter |
writer
Deprecated.
the output writer
|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Constructor and Description |
|---|
StreamHelper(InputStream inputStream)
Deprecated.
Creates a new stream helper and immediately starts capturing output from the given stream.
|
StreamHelper(InputStream inputStream,
org.slf4j.Logger processLogger,
StringBuffer contentBuffer)
Deprecated.
Creates a new stream helper and immediately starts capturing output from the given stream.
|
StreamHelper(InputStream inputStream,
OutputStream redirect,
org.slf4j.Logger processLogger,
StringBuffer contentBuffer)
Deprecated.
Creates a new stream helper and immediately starts capturing output from the given stream.
|
StreamHelper(InputStream inputStream,
OutputStream redirect,
StringBuffer contentBuffer)
Deprecated.
Creates a new stream helper and immediately starts capturing output from the given stream.
|
StreamHelper(InputStream inputStream,
StringBuffer contentBuffer)
Deprecated.
Creates a new stream helper and immediately starts capturing output from the given stream.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
append(String output)
Deprecated.
This method will write any output from the stream to the the content buffer and the logger.
|
protected void |
log(String output)
Deprecated.
If a logger has been specified, the output is written to the logger using the defined log level.
|
void |
run()
Deprecated.
Thread run
|
void |
stopReading()
Deprecated.
Tells the stream helper to stop reading and exit from the main loop, it then waits for the thread to die.
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yieldprotected StringBuffer contentBuffer
protected PrintWriter writer
protected org.slf4j.Logger processLogger
protected boolean keepReading
public StreamHelper(InputStream inputStream)
inputStream - the input streampublic StreamHelper(InputStream inputStream, StringBuffer contentBuffer)
inputStream - the input stream to read fromcontentBuffer - the buffer to write the captured output topublic StreamHelper(InputStream inputStream, org.slf4j.Logger processLogger, StringBuffer contentBuffer)
inputStream - the input stream to read fromprocessLogger - the logger to append tocontentBuffer - the buffer to write the captured output topublic StreamHelper(InputStream inputStream, OutputStream redirect, StringBuffer contentBuffer)
inputStream - the input stream to read fromredirect - a stream to also redirect the captured output tocontentBuffer - the buffer to write the captured output topublic StreamHelper(InputStream inputStream, OutputStream redirect, org.slf4j.Logger processLogger, StringBuffer contentBuffer)
inputStream - the input stream to read fromredirect - a stream to also redirect the captured output toprocessLogger - the logger to append tocontentBuffer - the buffer to write the captured output topublic void stopReading()
throws InterruptedException
InterruptedException - if the thread is interrupted while waiting for the main loop to come to an endThread.join()public void run()
protected void append(String output)
output - the stream outputprotected void log(String output)
output - the stream outputCopyright © 2009–2021 Opencast Project. All rights reserved.