The class to represent an OS process.
Parent Class
Type | Name | Signature |
---|---|---|
constructor | Process | public Process(string, string[], System.ProcessConfig) |
method S | create | public static Process create(string, string[]) |
method | getArgs | public String[] getArgs() |
method S | getCurrent | public static Process getCurrent() |
method | getEnvArg | public String getEnvArg(string) |
method | getErrorStream | public Stream getErrorStream() |
method | getExitCode | public int getExitCode() |
method | getName | public String getName() |
method | getReadStream | public Stream getReadStream() |
method | getWriteStream | public Stream getWriteStream() |
method | isAlive | public bool isAlive() |
method | kill | public int kill() |
method | start | public void start() |
method | wait | public int wait() |
method | wait | public bool wait(int) |
public Process(string name, string[] args, ProcessConfig config)
Create a process with specific settings.
Parameters
public static Process create(string name, string[] args)
A facade to create a process with default settings.
Parameters
Returns
public String[] getArgs()
Get the arguments of this process.
Returns
public static Process getCurrent()
Get the Process object for the currently running process.
Since the returned object represents the current process (a JVM instance on which Julian engine is running), most methods that have modifying behavior are not allowed to call.
Required Policies
System.Environment/read
Returns
public String getEnvArg(string name)
Get the environment variable. This method will only work against the current process object, otherwise it throws.
Required Policies
System.Environment/read
Parameters
Returns
public Stream getErrorStream()
Get a stream to read from this process's standard error. This stream is backed by an OS pipeline. Note, however, if the process was started with inherited IO, or an explicitly set ErrorStream, then one cannot read from it programmatically and thus this method returns null.
Returns
public int getExitCode()
Get the exit code. Result is undefined if the process is not terminated yet.
Required Policies
System.Process/control
Returns
public String getName()
Get the name of this process.
Returns
public Stream getReadStream()
Get a stream to read from this process. This stream is backed by an OS pipeline. Note, however, if the process was started with inherited IO, or an explicitly set OutputStream, then one cannot read from it programmatically and thus this method returns null.
Returns
public Stream getWriteStream()
Get a stream to write to this process. This stream is backed by an OS pipeline. Note, however, if the process was started with inherited IO, or an explicitly set InputStream, then one cannot write to it programmatically and thus this method returns null.
Returns
public bool isAlive()
Check if the process is alive. This method will return true only before start(), or after either wait() or kill() is called.
Returns
public int kill()
Kill the process.
Required Policies
System.Process/control
Returns
Throws
public void start()
Start the process. A process can only be started once.
Required Policies
System.Process/control
Throws
public int wait()
Wait for the process to finish.
Required Policies
System.Process/wait
Returns
public bool wait(int millisec)
Wait, for only specified milliseconds, for the process to finish.
Required Policies
System.Process/wait
Parameters
Returns