Package com.sun.enterprise.util
Class ProcessExecutor
- java.lang.Object
-
- com.sun.enterprise.util.ProcessExecutor
-
- Direct Known Subclasses:
KeystoreManager.KeytoolExecutor
public class ProcessExecutor extends Object
Deprecated.Use com.sun.enterprise.universal.process.ProcessManager instead- Version:
- 1.0
- Author:
- Kedar
-
-
Field Summary
Fields Modifier and Type Field Description static long
kDefaultTimeoutMillis
Deprecated.static long
kSleepTime
Deprecated.protected String[]
mCmdStrings
Deprecated.protected File
mErrFile
Deprecated.protected File
mOutFile
Deprecated.
-
Constructor Summary
Constructors Constructor Description ProcessExecutor(String[] cmd)
Deprecated.Creates new ProcessExecutorProcessExecutor(String[] cmd, long timeoutSeconds)
Deprecated.Creates new ProcessExecutorProcessExecutor(String[] cmd, long timeoutSeconds, String[] inputLines)
Deprecated.ProcessExecutor(String[] cmd, long timeoutSeconds, String[] inputLines, String[] env, File workingDir)
Deprecated.Creates a newProcessExecutor
that executes the given command.ProcessExecutor(String[] cmd, String[] inputLines)
Deprecated.Creates new ProcessExecutor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
execute()
Deprecated.String[]
execute(boolean bReturnOutputLines)
Deprecated.String[]
execute(boolean bReturnOutputLines, boolean bStartUpTimeLimit)
Deprecated.protected String
getExceptionMessage()
Deprecated.Allows a subclass to control the error message returned when a non-zero exit code is returned from a failed executionboolean
getExecutionRetentionFlag()
Deprecated.protected String
getFileBuffer(File file)
Deprecated.Returns the contents of a file as a String.String
getLastExecutionError()
Deprecated.Returns the last LAST_BYTES bytes in the error stream of last execution as a String, if the ProcessExecutor was configured properly.String
getLastExecutionOutput()
Deprecated.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)
Deprecated.int
getProcessExitValue()
Deprecated.Get the exit value of the process executed.Process
getSubProcess()
Deprecated.static void
main(String[] args)
Deprecated.void
retainBuffers()
Deprecated.void
setExecutionRetentionFlag(boolean s)
Deprecated.This is the setting after the fact that an instance of ProcessExecutor is created.void
setVerbose(boolean verbose)
Deprecated.
-
-
-
Field Detail
-
kDefaultTimeoutMillis
public static final long kDefaultTimeoutMillis
Deprecated.- See Also:
- Constant Field Values
-
kSleepTime
public static final long kSleepTime
Deprecated.- See Also:
- Constant Field Values
-
mCmdStrings
protected String[] mCmdStrings
Deprecated.
-
mOutFile
protected File mOutFile
Deprecated.
-
mErrFile
protected File mErrFile
Deprecated.
-
-
Constructor Detail
-
ProcessExecutor
public ProcessExecutor(String[] cmd)
Deprecated.Creates new ProcessExecutor
-
ProcessExecutor
public ProcessExecutor(String[] cmd, String[] inputLines)
Deprecated.Creates new ProcessExecutor
-
ProcessExecutor
public ProcessExecutor(String[] cmd, long timeoutSeconds)
Deprecated.Creates new ProcessExecutor
-
ProcessExecutor
public ProcessExecutor(String[] cmd, long timeoutSeconds, String[] inputLines)
Deprecated.
-
ProcessExecutor
public ProcessExecutor(String[] cmd, long timeoutSeconds, String[] inputLines, String[] env, File workingDir)
Deprecated.Creates a newProcessExecutor
that executes the given command.- Parameters:
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
-
setExecutionRetentionFlag
public void setExecutionRetentionFlag(boolean s)
Deprecated.This is the setting after the fact that an instance of ProcessExecutor is created. This is to be used in case the output and error of the last execute call has to be retained for latter analysis.- Parameters:
s
- boolean representing whether to retain, true means the buffers will be retained, false otherwise.
-
getExecutionRetentionFlag
public boolean getExecutionRetentionFlag()
Deprecated.
-
getLastExecutionError
public String getLastExecutionError()
Deprecated.Returns the last LAST_BYTES bytes in the error stream of last execution as a String, if the ProcessExecutor was configured properly. It may return null if the retentionFlag is set to false.
-
getLastExecutionOutput
public String getLastExecutionOutput()
Deprecated.Returns the last LAST_BYTES bytes in the output stream of last execution as a String, if the ProcessExecutor was configured properly. It may return null if the retentionFlag is set to false.
-
execute
public void execute() throws ExecException
Deprecated.- Throws:
ExecException
-
execute
public String[] execute(boolean bReturnOutputLines) throws ExecException
Deprecated.- Throws:
ExecException
-
getExceptionMessage
protected String getExceptionMessage()
Deprecated.Allows a subclass to control the error message returned when a non-zero exit code is returned from a failed execution- Returns:
-
execute
public String[] execute(boolean bReturnOutputLines, boolean bStartUpTimeLimit) throws ExecException
Deprecated.- Throws:
ExecException
-
getProcessExitValue
public int getProcessExitValue()
Deprecated.Get the exit value of the process executed. If this method is called before process execution is complete (i.e. before execute() method has returned, it will return -1. If sub process is terminated at timeout, the method will return -255
-
setVerbose
public void setVerbose(boolean verbose)
Deprecated.
-
getFileBuffer
protected String getFileBuffer(File file)
Deprecated.Returns the contents of a file as a String. It never returns a null. If the file is empty, an empty string is returned.- Parameters:
file
- the file to read
-
retainBuffers
public void retainBuffers()
Deprecated.
-
getSubProcess
public Process getSubProcess()
Deprecated.
-
main
public static void main(String[] args)
Deprecated.
-
-