|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.rice.cs.util.newjvm.ExecJVM
public final class ExecJVM
A utility class to allow executing another JVM.
Method Summary | |
---|---|
static String |
getExecutable()
Find the java executable. |
static void |
printOutput(Process theProc,
String msg,
String sourceName)
Prints the stdout and stderr of the given process, line by line. |
static Process |
runJVM(String mainClass,
String[] classParams,
String[] classPath,
String[] jvmParams,
File workDir)
Runs a new JVM. |
static Process |
runJVM(String mainClass,
String[] classParams,
String classPath,
String[] jvmParams,
File workDir)
Runs a new JVM. |
static Process |
runJVMPropagateClassPath(String mainClass,
String[] classParams,
File workDir)
Runs a new JVM, propagating the present classpath. |
static Process |
runJVMPropagateClassPath(String mainClass,
String[] classParams,
String[] jvmParams,
File workDir)
Runs a new JVM, propagating the present classpath. |
static void |
ventBuffers(Process theProc,
LinkedList<String> outLines,
LinkedList<String> errLines)
Empties BufferedReaders by copying lines into LinkedLists. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Process runJVM(String mainClass, String[] classParams, String[] classPath, String[] jvmParams, File workDir) throws IOException
mainClass
- Class to runclassParams
- Parameters to pass to the main classclassPath
- Array of items to put in classpath of new JVMjvmParams
- Array of additional command-line parameters to pass to JVM
Process
object corresponding to the executed JVM
IOException
public static Process runJVM(String mainClass, String[] classParams, String classPath, String[] jvmParams, File workDir) throws IOException
mainClass
- Class to runclassParams
- Parameters to pass to the main classclassPath
- Pre-formatted classpath parameterjvmParams
- Array of additional command-line parameters to pass to JVM
Process
object corresponding to the executed JVM
IOException
public static Process runJVMPropagateClassPath(String mainClass, String[] classParams, String[] jvmParams, File workDir) throws IOException
mainClass
- Class to runclassParams
- Parameters to pass to the main classjvmParams
- Array of additional command-line parameters to pass to JVM
Process
object corresponding to the executed JVM
IOException
public static Process runJVMPropagateClassPath(String mainClass, String[] classParams, File workDir) throws IOException
mainClass
- Class to runclassParams
- Parameters to pass to the main class
Process
object corresponding to the new JVM process
IOException
public static void ventBuffers(Process theProc, LinkedList<String> outLines, LinkedList<String> errLines) throws IOException
theProc
- a Process object whose output will be handledoutLines
- the LinkedList of Strings to be filled with the lines read from outBuferrLines
- the LinkedList of Strings to be filled with the lines read from errBuf
IOException
public static void printOutput(Process theProc, String msg, String sourceName) throws IOException
theProc
- a Process object whose output will be handledmsg
- an initial message to print before outputsourceName
- a short string to identify the process
IOException
- if there is a problem with the streamspublic static String getExecutable()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |