nl.uva.vlet.exec
Interface VProcess

All Known Implementing Classes:
LocalProcess

public interface VProcess

Simple abtract process class (Under construction) for local and remote command execution.


Method Summary
 void execute(java.lang.String[] cmds, boolean waitForCompletion)
          Execute command.
 int getExitValue()
          Get exit value.
 java.io.OutputStream getOutputStream()
          Get OutputStream to write to:
 java.lang.String getStderr()
          Returns stderr String after execution.
 java.lang.String getStdout()
          Returns stdout String after execution.
 void terminate()
          Terminate process immediatly.
 void waitFor()
          Wait for the process to terminate.
 

Method Detail

execute

void execute(java.lang.String[] cmds,
             boolean waitForCompletion)
             throws VlException
Execute command. cmds contains command line argument, where cmd[0] is the command to start and cmds[1] to cmds[...] are the arguments of the command.

Parameters:
waitForCompletion - whether the command should wait for the process to end
Throws:
VlException

terminate

void terminate()
Terminate process immediatly. It is recommended to do a waitFor() after this command before issueing a getStderr(), getStdout() or getExitValue() so the process stats are updated correctly.


getStdout

java.lang.String getStdout()
Returns stdout String after execution. Do a waitFor() to make sure all input is read


getStderr

java.lang.String getStderr()
Returns stderr String after execution. Do a waitFor() to make sure all input is read


waitFor

void waitFor()
             throws VlException
Wait for the process to terminate.

Throws:
VlException

getExitValue

int getExitValue()
Get exit value. Process must have terminated


getOutputStream

java.io.OutputStream getOutputStream()
Get OutputStream to write to: