Package org.wildfly.plugin.core
Class ConsoleConsumer
- java.lang.Object
-
- org.wildfly.plugin.core.ConsoleConsumer
-
- All Implemented Interfaces:
Runnable
@Deprecated(forRemoval=true) public class ConsoleConsumer extends Object implements Runnable
Deprecated, for removal: This API element is subject to removal in a future version.moved to new https://github.com/wildfly/wildfly-plugin-tools projectA utility which will consume output from anInputStream
and write it to anOutputStream
. This is commonly used when a processesstdout
orstderr
needs to be consumed and redirected somewhere.- Author:
- James R. Perkins
-
-
Constructor Summary
Constructors Constructor Description ConsoleConsumer(InputStream in, OutputStream out)
Deprecated, for removal: This API element is subject to removal in a future version.Creates a new console consumer which will pipe theInputStream
to theOutputStream
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
run()
Deprecated, for removal: This API element is subject to removal in a future version.static Thread
start(InputStream in, OutputStream out)
Deprecated, for removal: This API element is subject to removal in a future version.Creates and starts a daemon thread which pipes intInputStream
to theOutputStream
.static Thread
start(Process process, OutputStream out)
Deprecated, for removal: This API element is subject to removal in a future version.
-
-
-
Constructor Detail
-
ConsoleConsumer
public ConsoleConsumer(InputStream in, OutputStream out)
Deprecated, for removal: This API element is subject to removal in a future version.Creates a new console consumer which will pipe theInputStream
to theOutputStream
.- Parameters:
in
- the input stream that should be pippedout
- the output stream where the data should be written
-
-
Method Detail
-
start
public static Thread start(Process process, OutputStream out)
Deprecated, for removal: This API element is subject to removal in a future version.Creates and starts a daemon thread which consumes a processesstdout
stream and pipes the date to the output stream.Note that when using this method the
ProcessBuilder.redirectErrorStream(boolean)
should likely betrue
. Otherwise another thread should be created to consumestderr
.- Parameters:
process
- the processout
- the output stream where the data should be written- Returns:
- the thread that was started
-
start
public static Thread start(InputStream in, OutputStream out)
Deprecated, for removal: This API element is subject to removal in a future version.Creates and starts a daemon thread which pipes intInputStream
to theOutputStream
.- Parameters:
in
- the input stream that should be pippedout
- the output stream where the data should be written- Returns:
- the thread that was started
-
-