|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.optimizationservices.oscommon.util.ProcessUtil
public class ProcessUtil
The ProcessUtil
is a process and runtime (or terminal environment) related utility class.
For example it provides methods to run commands (e.g. DOS or UNIX commands from within the programming
codes.
Constructor Summary | |
---|---|
ProcessUtil()
constructor |
Method Summary | |
---|---|
static double |
getFreeMemory()
get free physical memory on the system. |
static boolean |
killProcessByID(java.lang.String processID)
kill a process by the process id. |
static boolean |
killProcessByName(java.lang.String processName)
kill a process by the process name. |
static boolean |
launch(java.lang.String command)
Launch a process specified by a command string. |
static boolean |
launchAndWaitForFinish(java.lang.String command)
Launch a command specified by a command string and wait for the process to finish before proceeding to the next line. |
static boolean |
launchAndWaitForFinish(java.lang.String command,
java.lang.String[] envp,
java.io.File dir)
Launch a command specified by a command string along with some environment parameters and wait for the process to finish before proceeding to the next line. |
static void |
main(java.lang.String[] argv)
main for test purposes. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ProcessUtil()
Method Detail |
---|
public static boolean launch(java.lang.String command)
command
- holds the command that is usually typed in a terminal.
public static boolean launchAndWaitForFinish(java.lang.String command)
command
- holds the command that is usually typed in a terminal.
public static boolean launchAndWaitForFinish(java.lang.String command, java.lang.String[] envp, java.io.File dir)
command
- holds the command that is usually typed in a terminal.envp
- holds array of strings, each element of which has environment variable settings in
format name=value.dir
- holds the working directory of the subprocess, or null if the subprocess
should inherit the working directory of the current process.
public static boolean killProcessByName(java.lang.String processName)
processName
- holds the process name.
public static boolean killProcessByID(java.lang.String processID)
processID
- holds the process id.
public static double getFreeMemory()
public static void main(java.lang.String[] argv)
argv
- command line arguments.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |