org.mmbase.util.externalprocess
Class ProcessFactory

java.lang.Object
  extended by org.mmbase.util.externalprocess.ProcessFactory

public class ProcessFactory
extends Object

Process Factory creates a external process. The factory could be used to create a process in another way than java.lang. Runtime.exec();

Since:
MMBase-1.6
Version:
$Id: ProcessFactory.java 34900 2009-05-01 16:29:42Z michiel $
Author:
Nico Klasens (Finalist IT Group)

Method Summary
 Process exec(String cmd)
          Executes the specified command in a separate process.
 Process exec(String[] cmdarray)
          Executes the specified command and arguments in a separate process.
 Process exec(String[] cmdarray, String[] envp)
          Executes the specified command and arguments in a separate process with the specified environment.
 Process exec(String[] cmdarray, String[] envp, String dir)
          Executes the specified command and arguments in a separate process with the specified environment and working directory.
 Process exec(String cmd, String[] envp)
          Executes the specified command in a separate process with the specified environment.
 Process exec(String cmd, String[] envp, String dir)
          Executes the specified command in a separate process with the specified environment and working directory.
static ProcessFactory getFactory()
          get the Process Factory.instance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getFactory

public static ProcessFactory getFactory()
get the Process Factory.instance

Returns:
ProcessFactory

exec

public Process exec(String cmd)
             throws IOException
Executes the specified command in a separate process.

Parameters:
cmd - the command to call
Returns:
Process a Process object for managing the external process
Throws:
IOException - if an I/O error occurs.

exec

public Process exec(String[] cmdarray)
             throws IOException
Executes the specified command and arguments in a separate process.

Parameters:
cmdarray - array containing the command to call and its arguments
Returns:
Process a Process object for managing the external process
Throws:
IOException - if an I/O error occurs.

exec

public Process exec(String[] cmdarray,
                    String[] envp)
             throws IOException
Executes the specified command and arguments in a separate process with the specified environment.

Parameters:
cmdarray - array containing the command to call and its arguments
envp - array of strings, each element of which has environment variable settings in format name=value.
Returns:
Process a Process object for managing the external process
Throws:
IOException - if an I/O error occurs.

exec

public Process exec(String cmd,
                    String[] envp)
             throws IOException
Executes the specified command in a separate process with the specified environment.

Parameters:
cmd - the command to call
envp - array of strings, each element of which has environment variable settings in format name=value.
Returns:
Process a Process object for managing the external process
Throws:
IOException - if an I/O error occurs.

exec

public Process exec(String cmd,
                    String[] envp,
                    String dir)
             throws IOException
Executes the specified command in a separate process with the specified environment and working directory.

Parameters:
cmd - the command to call
envp - array of strings, each element of which has environment variable settings in format name=value.
dir - the working directory of the subprocess
Returns:
Process a Process object for managing the external process
Throws:
IOException - if an I/O error occurs.

exec

public Process exec(String[] cmdarray,
                    String[] envp,
                    String dir)
             throws IOException
Executes the specified command and arguments in a separate process with the specified environment and working directory.

Parameters:
cmdarray - array containing the command to call and its arguments
envp - array of strings, each element of which has environment variable settings in format name=value.
dir - the working directory of the subprocess
Returns:
Process a Process object for managing the external process
Throws:
IOException - if an I/O error occurs.


MMBase 2.0-SNAPSHOT - null