Class WrapperProcess
- Since:
- Wrapper 3.4.0
- Author:
- Tanuki Software Development Team <support@tanukisoftware.com>
-
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy()
Kills the subprocess.int
Returns the exit value for the subprocess.protected void
finalize()
Finalize method.Gets the error stream of the subprocess.Gets the input stream of the subprocess.Gets the output stream of the subprocess.int
getPID()
Returns the PID of the process.Gets the error stream of the subprocess.getStdIn()
Gets the output stream of the subprocess.Gets the input stream of the subprocess.boolean
isAlive()
Returns true if the process is still alive.int
waitFor()
Causes the current thread to wait, if necessary, until the process represented by this Process object has terminated.
-
Method Details
-
finalize
Finalize method. -
getPID
public int getPID()Returns the PID of the process.- Returns:
- The PID of the process.
-
getInputStream
Gets the input stream of the subprocess. The stream obtains data piped from the standard output stream of the process represented by this WrapperProcess object.This is an alias of the getStdOut() method.
Implementation note: It is a good idea for the input stream to be buffered.
- Returns:
- The input stream connected to the normal output of the subprocess.
- Throws:
IOException
- If we are unable to access the stream.
-
getStdOut
Gets the input stream of the subprocess. The stream obtains data piped from the standard output stream of the process represented by this WrapperProcess object.This is an alias of the getInputStream() method.
Implementation note: It is a good idea for the input stream to be buffered.
- Returns:
- The input stream connected to the normal output of the subprocess.
- Throws:
IOException
- If we are unable to access the stream.
-
getErrorStream
Gets the error stream of the subprocess. The stream obtains data piped from the error output stream of the process represented by this WrapperProcess object.This is an alias of the getStdErr() method.
Implementation note: It is a good idea for the input stream to be buffered.
- Returns:
- The input stream connected to the error stream of the subprocess.
- Throws:
IOException
- If we are unable to access the stream.
-
getStdErr
Gets the error stream of the subprocess. The stream obtains data piped from the error output stream of the process represented by this WrapperProcess object.This is an alias of the getErrorStream() method.
Implementation note: It is a good idea for the input stream to be buffered.
- Returns:
- The input stream connected to the error stream of the subprocess.
- Throws:
IOException
- If we are unable to access the stream.
-
getOutputStream
Gets the output stream of the subprocess. Output to the stream is piped into the standard input stream of the process represented by this WrapperProcess object.This is an alias of the getStdIn() method.
Implementation note: It is a good idea for the output stream to be buffered.
- Returns:
- The output stream connected to the normal input of the subprocess.
- Throws:
IOException
- If we are unable to access the stream.
-
getStdIn
Gets the output stream of the subprocess. Output to the stream is piped into the standard input stream of the process represented by this WrapperProcess object.This is an alias of the getOutputStream() method.
Implementation note: It is a good idea for the output stream to be buffered.
- Returns:
- The output stream connected to the normal input of the subprocess.
- Throws:
IOException
- If we are unable to access the stream.
-
waitFor
Causes the current thread to wait, if necessary, until the process represented by this Process object has terminated. This method returns immediately if the subprocess has already terminated. If the subprocess has not yet terminated, the calling thread will be blocked until the subprocess exits.- Returns:
- The exit value of the process. By convention, 0 indicates normal termination.
- Throws:
InterruptedException
- If the current thread is interrupted by another thread while it is waiting, then the wait is ended and an InterruptedException is thrown.
-
exitValue
Returns the exit value for the subprocess.- Returns:
- The exit value of the subprocess represented by this WrapperProcess object. By convention, the value 0 indicates normal termination.
- Throws:
IllegalThreadStateException
- if the process is still alive and has not yet teminated.
-
isAlive
public boolean isAlive()Returns true if the process is still alive.- Returns:
- True if the process is alive, false if it has terminated.
- Throws:
WrapperLicenseError
- If the function is called other than in the Professional Edition or from a Standalone JVM.
-
destroy
public void destroy()Kills the subprocess. The subprocess represented by this Process object is forcibly terminated if it is still running.- Throws:
WrapperLicenseError
- If the function is called other than in the Professional Edition or from a Standalone JVM.
-