|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.googlecode.icegem.utils.JavaProcessLauncher
public class JavaProcessLauncher
Platform independent java process launcher.
| Field Summary | |
|---|---|
static long |
DEFAULT_PROCESS_STARTUP_SHUTDOWN_TIME
Field DEFAULT_PROCESS_STARTUP_SHUTDOWN_TIME |
static String |
PROCESS_STARTUP_COMPLETED
Each process that starts with confirmation must write a startup completed string into it's standard output. |
| Constructor Summary | |
|---|---|
JavaProcessLauncher()
Constructor JavaProcessLauncher creates a new JavaProcessLauncher instance. |
|
JavaProcessLauncher(boolean redirectProcessInputStreamToParentProcessStdOut,
boolean redirectProcessErrorStreamToParentProcessStdOut)
Constructor JavaProcessLauncher creates a new JavaProcessLauncher instance. |
|
JavaProcessLauncher(boolean redirectProcessInputStreamToParentProcessStdOut,
boolean redirectProcessErrorStreamToParentProcessStdOut,
boolean printType)
|
|
| Method Summary | |
|---|---|
int |
runAndWaitProcessExitCode(Class klass,
String[] javaArguments,
String[] processArguments)
Runs process with arguments based on a specified class in a separate VM. |
Process |
runWithConfirmation(Class klass,
String[] javaArguments,
String[] processArguments)
Runs process based on a specified class in a separate VM using array of arguments. |
Process |
runWithoutConfirmation(Class<?> clazz,
String[] javaArguments,
String[] processArguments)
Runs a process and returns the Process object. |
Process |
runWithStartupDelay(Class klass,
String[] javaArguments,
String[] processArguments)
Runs process with arguments based on a specified class in a separate VM. |
Process |
runWithStartupDelay(Class klass,
String[] javaArguments,
String[] processArguments,
long processStartupTime)
Runs process with arguments based on a specified class in a separate VM. |
void |
setRedirectProcessErrorStreamToParentProcessStdOut(boolean redirectProcessErrorStreamToParentProcessStdOut)
Sets the redirectProcessErrorStreamToParentProcessStdOut of this JavaProcessLauncher object. |
void |
setRedirectProcessInputStreamToParentProcessStdOut(boolean redirectProcessInputStreamToParentProcessStdOut)
Sets the redirectProcessInputStreamToParentProcessStdOut of this JavaProcessLauncher object. |
void |
stopByDestroyingProcess(Process process)
Stops process by destroying process. |
void |
stopBySendingNewLineIntoProcess(Process process)
Stops process by sending new line to it's output stream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String PROCESS_STARTUP_COMPLETED
public static final long DEFAULT_PROCESS_STARTUP_SHUTDOWN_TIME
| Constructor Detail |
|---|
public JavaProcessLauncher()
public JavaProcessLauncher(boolean redirectProcessInputStreamToParentProcessStdOut,
boolean redirectProcessErrorStreamToParentProcessStdOut)
redirectProcessInputStreamToParentProcessStdOut - of type booleanredirectProcessErrorStreamToParentProcessStdOut - of type boolean
public JavaProcessLauncher(boolean redirectProcessInputStreamToParentProcessStdOut,
boolean redirectProcessErrorStreamToParentProcessStdOut,
boolean printType)
| Method Detail |
|---|
public void setRedirectProcessErrorStreamToParentProcessStdOut(boolean redirectProcessErrorStreamToParentProcessStdOut)
redirectProcessErrorStreamToParentProcessStdOut - boolean flag.public void setRedirectProcessInputStreamToParentProcessStdOut(boolean redirectProcessInputStreamToParentProcessStdOut)
redirectProcessInputStreamToParentProcessStdOut - boolean flag.
public int runAndWaitProcessExitCode(Class klass,
String[] javaArguments,
String[] processArguments)
throws IOException,
InterruptedException
klass - of type ClassjavaArguments - arguments for javaprocessArguments - arguments for process
IOException - when
InterruptedException - when
public Process runWithoutConfirmation(Class<?> clazz,
String[] javaArguments,
String[] processArguments)
throws IOException,
InterruptedException
clazz - - the class to runjavaArguments - arguments for javaprocessArguments - arguments for process
IOException
InterruptedException
public Process runWithConfirmation(Class klass,
String[] javaArguments,
String[] processArguments)
throws IOException,
InterruptedException
klass - of type ClassjavaArguments - arguments for javaprocessArguments - arguments for process
IOException - when
InterruptedException - when
public Process runWithStartupDelay(Class klass,
String[] javaArguments,
String[] processArguments)
throws IOException,
InterruptedException,
TimeoutException
klass - of type ClassjavaArguments - arguments for javaprocessArguments - arguments for process
IOException - when
InterruptedException - when
TimeoutException - when
public Process runWithStartupDelay(Class klass,
String[] javaArguments,
String[] processArguments,
long processStartupTime)
throws IOException,
InterruptedException,
TimeoutException
klass - of type ClassprocessStartupTime - time in milliseconds that launcher spend on waiting process
after it's start.javaArguments - arguments for javaprocessArguments - arguments for process
IOException - when
InterruptedException - when
TimeoutException - if process startup is not completed in time.
public void stopBySendingNewLineIntoProcess(Process process)
throws IOException,
InterruptedException
process - of type Process
IOException - when
InterruptedException
public void stopByDestroyingProcess(Process process)
throws IOException
process - of type Process
IOException - when
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||