public class ConsumOutStreamProcess
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
(package private) class |
ConsumOutStreamProcess.OutputBufferConsumer |
| Modifier and Type | Field and Description |
|---|---|
static int |
PROCESS_COMMAND_EXECUTE_ERR |
static int |
PROCESS_COMMAND_NOT_INITIAL |
static int |
PROCESS_NORMAL_END |
static int |
WAIT_FOREVER |
| Constructor and Description |
|---|
ConsumOutStreamProcess(java.lang.String command,
boolean printOutput,
boolean useTimeout) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getCommand() |
void |
setCommand(java.lang.String command) |
void |
setTimeout(int timeout)
timeout should be set to a NON-negative int value or 0
If timeout is 0, will wait forever until the process end.
|
int |
start() |
public static final int PROCESS_NORMAL_END
public static final int PROCESS_COMMAND_NOT_INITIAL
public static final int PROCESS_COMMAND_EXECUTE_ERR
public static final int WAIT_FOREVER
public ConsumOutStreamProcess(java.lang.String command,
boolean printOutput,
boolean useTimeout)
command - The shell command to be executed.printOutput - True, the process's stdout and stderr will be printed.useTimeout - Ture, wait end of process for timeout seconds.
Call setTimeout(timeout) to set the timeout.public java.lang.String getCommand()
public void setCommand(java.lang.String command)
command - the command to setpublic void setTimeout(int timeout)
timeout - public int start()
Copyright © SAS Institute. All Rights Reserved.