org.apache.tools.ant.taskdefs
public class PumpStreamHandler extends Object implements ExecuteStreamHandler
Since: Ant 1.2
Nested Class Summary | |
---|---|
protected static class | PumpStreamHandler.ThreadWithPumper
Specialized subclass that allows access to the running StreamPumper.
|
Constructor Summary | |
---|---|
PumpStreamHandler(OutputStream out, OutputStream err, InputStream input, boolean nonBlockingRead)
Construct a new PumpStreamHandler . | |
PumpStreamHandler(OutputStream out, OutputStream err, InputStream input)
Construct a new PumpStreamHandler . | |
PumpStreamHandler(OutputStream out, OutputStream err)
Construct a new PumpStreamHandler . | |
PumpStreamHandler(OutputStream outAndErr)
Construct a new PumpStreamHandler . | |
PumpStreamHandler()
Construct a new PumpStreamHandler . |
Method Summary | |
---|---|
protected void | createProcessErrorPump(InputStream is, OutputStream os)
Create the pump to handle error output. |
protected void | createProcessOutputPump(InputStream is, OutputStream os)
Create the pump to handle process output. |
protected Thread | createPump(InputStream is, OutputStream os)
Creates a stream pumper to copy the given input stream to the
given output stream. |
protected Thread | createPump(InputStream is, OutputStream os, boolean closeWhenExhausted)
Creates a stream pumper to copy the given input stream to the
given output stream. |
protected Thread | createPump(InputStream is, OutputStream os, boolean closeWhenExhausted, boolean nonBlockingIO)
Creates a stream pumper to copy the given input stream to the
given output stream. |
protected void | finish(Thread t)
Waits for a thread to finish while trying to make it finish
quicker by stopping the pumper (if the thread is a ThreadWithPumper instance) or interrupting
the thread.
|
protected OutputStream | getErr()
Get the error stream. |
protected OutputStream | getOut()
Get the output stream. |
void | setProcessErrorStream(InputStream is)
Set the InputStream from which to read the
standard error of the process. |
void | setProcessInputStream(OutputStream os)
Set the OutputStream by means of which
input can be sent to the process. |
void | setProcessOutputStream(InputStream is)
Set the InputStream from which to read the
standard output of the process. |
void | start()
Start the Thread s. |
void | stop()
Stop pumping the streams. |
PumpStreamHandler
.Parameters: out the output OutputStream
. err the error OutputStream
. input the input InputStream
. nonBlockingRead set it to true
if the input should be
read with simulated non blocking IO.
PumpStreamHandler
.Parameters: out the output OutputStream
. err the error OutputStream
. input the input InputStream
.
PumpStreamHandler
.Parameters: out the output OutputStream
. err the error OutputStream
.
PumpStreamHandler
.Parameters: outAndErr the output/error OutputStream
.
PumpStreamHandler
.Parameters: is the input stream to copy from. os the output stream to copy to.
Parameters: is the InputStream
. os the OutputStream
.
Parameters: is the input stream to copy from. os the output stream to copy to.
Returns: a thread object that does the pumping.
Parameters: is the input stream to copy from. os the output stream to copy to. closeWhenExhausted if true close the inputstream.
Returns: a thread object that does the pumping, subclasses
should return an instance of
ThreadWithPumper
.
Parameters: is the input stream to copy from. os the output stream to copy to. closeWhenExhausted if true close the inputstream. nonBlockingIO set it to true
to use simulated non
blocking IO.
Returns: a thread object that does the pumping, subclasses
should return an instance of
ThreadWithPumper
.
Since: Ant 1.8.2
ThreadWithPumper
instance) or interrupting
the thread.
Since: Ant 1.8.0
Returns: OutputStream
.
Returns: OutputStream
.
InputStream
from which to read the
standard error of the process.Parameters: is the InputStream
.
OutputStream
by means of which
input can be sent to the process.Parameters: os the OutputStream
.
InputStream
from which to read the
standard output of the process.Parameters: is the InputStream
.
Thread
s.