hudson
Class Proc.LocalProc

java.lang.Object
  extended by hudson.Proc
      extended by hudson.Proc.LocalProc
Enclosing class:
Proc

public static final class Proc.LocalProc
extends Proc

Locally launched process.


Nested Class Summary
 
Nested classes/interfaces inherited from class hudson.Proc
Proc.LocalProc, Proc.RemoteProc
 
Field Summary
static InputStream SELFPUMP_INPUT
           
static OutputStream SELFPUMP_OUTPUT
           
 
Fields inherited from class hudson.Proc
SHOW_PID
 
Constructor Summary
Proc.LocalProc(String[] cmd, Map<String,String> env, InputStream in, OutputStream out)
           
Proc.LocalProc(String[] cmd, String[] env, InputStream in, OutputStream out)
           
Proc.LocalProc(String[] cmd, String[] env, InputStream in, OutputStream out, File workDir)
           
Proc.LocalProc(String[] cmd, String[] env, InputStream in, OutputStream out, OutputStream err, File workDir)
           
Proc.LocalProc(String[] cmd, String[] env, OutputStream out, File workDir)
           
Proc.LocalProc(String cmd, Map<String,String> env, OutputStream out, File workDir)
           
Proc.LocalProc(String cmd, String[] env, OutputStream out, File workDir)
           
 
Method Summary
 InputStream getStderr()
          Returns an InputStream to read from stderr of the child process.
 OutputStream getStdin()
          Returns an OutputStream to write to stdin of the child process.
 InputStream getStdout()
          Returns an InputStream to read from stdout of the child process.
 boolean isAlive()
          Checks if the process is still alive.
 int join()
          Waits for the completion of the process.
 void kill()
          Terminates the process.
 
Methods inherited from class hudson.Proc
joinWithTimeout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SELFPUMP_INPUT

public static final InputStream SELFPUMP_INPUT

SELFPUMP_OUTPUT

public static final OutputStream SELFPUMP_OUTPUT
Constructor Detail

Proc.LocalProc

public Proc.LocalProc(String cmd,
                      Map<String,String> env,
                      OutputStream out,
                      File workDir)
               throws IOException
Throws:
IOException

Proc.LocalProc

public Proc.LocalProc(String[] cmd,
                      Map<String,String> env,
                      InputStream in,
                      OutputStream out)
               throws IOException
Throws:
IOException

Proc.LocalProc

public Proc.LocalProc(String cmd,
                      String[] env,
                      OutputStream out,
                      File workDir)
               throws IOException
Throws:
IOException

Proc.LocalProc

public Proc.LocalProc(String[] cmd,
                      String[] env,
                      OutputStream out,
                      File workDir)
               throws IOException
Throws:
IOException

Proc.LocalProc

public Proc.LocalProc(String[] cmd,
                      String[] env,
                      InputStream in,
                      OutputStream out)
               throws IOException
Throws:
IOException

Proc.LocalProc

public Proc.LocalProc(String[] cmd,
                      String[] env,
                      InputStream in,
                      OutputStream out,
                      File workDir)
               throws IOException
Throws:
IOException

Proc.LocalProc

public Proc.LocalProc(String[] cmd,
                      String[] env,
                      InputStream in,
                      OutputStream out,
                      OutputStream err,
                      File workDir)
               throws IOException
Parameters:
err - null to redirect stderr to stdout.
Throws:
IOException
Method Detail

getStdout

public InputStream getStdout()
Description copied from class: Proc
Returns an InputStream to read from stdout of the child process.

When this method returns null, Proc.LocalProc will internally pump the output from the child process to your OutputStream of choosing.

Specified by:
getStdout in class Proc
Returns:
null unless Launcher.ProcStarter.readStdout() is used to indicate that the caller intends to pump the stream by itself.

getStderr

public InputStream getStderr()
Description copied from class: Proc
Returns an InputStream to read from stderr of the child process.

When this method returns null, Proc.LocalProc will internally pump the output from the child process to your OutputStream of choosing.

Specified by:
getStderr in class Proc
Returns:
null unless Launcher.ProcStarter.readStderr() is used to indicate that the caller intends to pump the stream by itself.

getStdin

public OutputStream getStdin()
Description copied from class: Proc
Returns an OutputStream to write to stdin of the child process.

When this method returns null, Proc.LocalProc will internally pump the InputStream of your choosing to the child process.

Specified by:
getStdin in class Proc
Returns:
null unless Launcher.ProcStarter.writeStdin() is used to indicate that the caller intends to pump the stream by itself.

join

public int join()
         throws InterruptedException,
                IOException
Waits for the completion of the process.

Specified by:
join in class Proc
Throws:
IOException - if there's an error launching/joining a process and a stack trace could help the trouble-shooting.
InterruptedException

isAlive

public boolean isAlive()
                throws IOException,
                       InterruptedException
Description copied from class: Proc
Checks if the process is still alive.

Specified by:
isAlive in class Proc
Throws:
IOException
InterruptedException

kill

public void kill()
          throws InterruptedException,
                 IOException
Description copied from class: Proc
Terminates the process.

Specified by:
kill in class Proc
Throws:
IOException - if there's an error killing a process and a stack trace could help the trouble-shooting.
InterruptedException


Copyright © 2004-2013. All Rights Reserved.