Class 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 Detail

      • kDefaultTimeoutMillis

        public static final long kDefaultTimeoutMillis
        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 new ProcessExecutor that executes the given command.
        Parameters:
        cmd - String that has command name and its command line arguments
        timeoutSeconds - 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.
      • 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:
      • 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
      • getLatestOutput

        protected String getLatestOutput​(File f)
        Deprecated.
      • retainBuffers

        public void retainBuffers()
        Deprecated.
      • getSubProcess

        public Process getSubProcess()
        Deprecated.
      • main

        public static void main​(String[] args)
        Deprecated.