|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.enterprise.util.ProcessExecutor
public class ProcessExecutor
| Field Summary | |
|---|---|
static long |
kDefaultTimeoutMillis
|
static long |
kSleepTime
|
protected String[] |
mCmdStrings
|
protected File |
mErrFile
|
protected File |
mOutFile
|
| Constructor Summary | |
|---|---|
ProcessExecutor(String[] cmd)
Creates new ProcessExecutor |
|
ProcessExecutor(String[] cmd,
long timeoutSeconds)
Creates new ProcessExecutor |
|
ProcessExecutor(String[] cmd,
long timeoutSeconds,
String[] inputLines)
|
|
ProcessExecutor(String[] cmd,
long timeoutSeconds,
String[] inputLines,
String[] env,
File workingDir)
Creates a new ProcessExecutor that executes the given
command. |
|
ProcessExecutor(String[] cmd,
String[] inputLines)
Creates new ProcessExecutor |
|
| Method Summary | |
|---|---|
void |
execute()
|
String[] |
execute(boolean bReturnOutputLines)
|
String[] |
execute(boolean bReturnOutputLines,
boolean bStartUpTimeLimit)
|
protected String |
getExceptionMessage()
Allows a subclass to control the error message returned when a non-zero exit code is returned from a failed execution |
boolean |
getExecutionRetentionFlag()
|
protected String |
getFileBuffer(File file)
Returns the contents of a file as a String. |
String |
getLastExecutionError()
Returns the last LAST_BYTES bytes in the error stream of last execution as a String, if the ProcessExecutor was configured properly. |
String |
getLastExecutionOutput()
Returns the last LAST_BYTES bytes in the output stream of last execution as a String, if the ProcessExecutor was configured properly. |
protected String |
getLatestOutput(File f)
|
int |
getProcessExitValue()
Get the exit value of the process executed. |
Process |
getSubProcess()
|
static void |
main(String[] args)
|
void |
retainBuffers()
|
void |
setExecutionRetentionFlag(boolean s)
This is the setting after the fact that an instance of ProcessExecutor is created. |
void |
setVerbose(boolean verbose)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final long kDefaultTimeoutMillis
public static final long kSleepTime
protected String[] mCmdStrings
protected File mOutFile
protected File mErrFile
| Constructor Detail |
|---|
public ProcessExecutor(String[] cmd)
public ProcessExecutor(String[] cmd,
String[] inputLines)
public ProcessExecutor(String[] cmd,
long timeoutSeconds)
public ProcessExecutor(String[] cmd,
long timeoutSeconds,
String[] inputLines)
public ProcessExecutor(String[] cmd,
long timeoutSeconds,
String[] inputLines,
String[] env,
File workingDir)
ProcessExecutor that executes the given
command.
cmd - String that has command name and its command line argumentstimeoutSeconds - long integer timeout to be applied in seconds. After this time
if the process to execute does not end, it will be destroyed.| Method Detail |
|---|
public void setExecutionRetentionFlag(boolean s)
s - boolean representing whether to retain, true means the buffers
will be retained, false otherwise.public boolean getExecutionRetentionFlag()
public String getLastExecutionError()
public String getLastExecutionOutput()
public void execute()
throws ExecException
ExecException
public String[] execute(boolean bReturnOutputLines)
throws ExecException
ExecExceptionprotected String getExceptionMessage()
public String[] execute(boolean bReturnOutputLines,
boolean bStartUpTimeLimit)
throws ExecException
ExecExceptionpublic int getProcessExitValue()
public void setVerbose(boolean verbose)
protected String getFileBuffer(File file)
file - the file to readprotected String getLatestOutput(File f)
public void retainBuffers()
public Process getSubProcess()
public static void main(String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||