wt.util
Class ProcessLauncher

java.lang.Object
  extended by wt.util.ProcessLauncher

public class ProcessLauncher
extends Object

Performs the process using another thread to start sending output, before processing has completed.

Supported API: true

Extendable: false

See Also:
Process

Nested Class Summary
 class wt.util.ProcessLauncher.TimeoutException
           
 
Constructor Summary
ProcessLauncher(String command)
          Create an instance to run the command;

Supported API: true
 
Method Summary
 String getCommand()
          Tell the client what the command was when constructor was called.
 int runProcess()
          Launch the subprocess and wait for it to complete.
 void setErrorStream(PrintStream error_stream)
          The errors from the process and local class methods will be written to this PrintStream, for reading to begin before processing completes.
 void setErrorWriter(PrintWriter error_writer)
          The errors from the process and local class methods will be written to this PrintWriter, for reading to begin after the process completes.
 void setOutStream(PrintStream out_stream)
          The output from the process's output stream will be written to this PrintStream, for reading to begin before processing completes.
 void setOutWriter(PrintWriter out_writer)
          The output from the process's output stream will be written to this PrintWriter, for reading to begin after the process completes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProcessLauncher

public ProcessLauncher(String command)
Create an instance to run the command;

Supported API: true

Parameters:
command - Process this command.
Method Detail

getCommand

public final String getCommand()
Tell the client what the command was when constructor was called.

Supported API: true

Returns:
The command entered by this class' constructor.

setErrorWriter

public void setErrorWriter(PrintWriter error_writer)
The errors from the process and local class methods will be written to this PrintWriter, for reading to begin after the process completes. Will only take effect if invoked prior to runProcess().

Supported API: true

Parameters:
error_writer - After processing completes, review errors from here.

setOutWriter

public void setOutWriter(PrintWriter out_writer)
The output from the process's output stream will be written to this PrintWriter, for reading to begin after the process completes. Will only take effect if invoked prior to runProcess().

Supported API: true

Parameters:
out_writer - After processing completes, review the process' progression from here.

setErrorStream

public void setErrorStream(PrintStream error_stream)
The errors from the process and local class methods will be written to this PrintStream, for reading to begin before processing completes. Will only take effect if invoked prior to runProcess().

Supported API: true

Parameters:
error_stream - While still processing, look at errors from here.

setOutStream

public void setOutStream(PrintStream out_stream)
The output from the process's output stream will be written to this PrintStream, for reading to begin before processing completes. Will only take effect if invoked prior to runProcess().

Supported API: true

Parameters:
out_stream - While still processing, look at the process' progression from here.

runProcess

public final int runProcess()
                     throws IOException,
                            wt.util.ProcessLauncher.TimeoutException
Launch the subprocess and wait for it to complete.

Supported API: true

Returns:
the return code of the subprocess
Throws:
IOException - Forwarded from runProcess(long,long).
wt.util.ProcessLauncher.TimeoutException