public interface JvmLauncher
| Modifier and Type | Method and Description |
|---|---|
void |
addAppArgument(File file)
Adds the specified pathname as an argument to the application.
|
void |
addAppArgumentLine(String line)
Adds the specified comma separated argument line as arguments to the application.
|
void |
addAppArguments(String... values)
Adds the specified values as arguments to the application.
|
void |
addClasspathEntries(File... paths)
Adds the specified paths to the system classpath of the JVM.
|
void |
addClasspathEntries(String... paths)
Adds the specified paths to the system classpath of the JVM.
|
void |
addJvmArgument(File file)
Adds the specified pathname as an argument to the JVM.
|
void |
addJvmArgumentLine(String line)
Adds the specified comma separated argument line as arguments to the JVM.
|
void |
addJvmArguments(String... values)
Adds the specified values as arguments to the JVM.
|
int |
execute()
Launches a JVM according to the configuration of this launcher and waits for its termination.
|
String |
getClasspath()
Gets the currently configured system classpath.
|
String |
getCommandLine()
Gets a string representation of the currently configured command line.
|
void |
kill()
Forcibly kill the process that was launched, if supported by the JvmLauncher implementation.
|
void |
setAppendOutput(boolean appendOutput)
Controls whether the redirected output should be appended to an existing output file (if
any).
|
void |
setJarFile(File jarFile)
Sets the JAR file containing the main class to execute.
|
void |
setJvm(String command)
Sets the command to launch the JVM.
|
void |
setMainClass(String mainClass)
Sets the qualified name of the Java class to execute.
|
void |
setOutputFile(File outputFile)
Sets the file to which the output of the JVM is redirected.
|
void |
setSpawn(boolean spawn)
Sets whether the JVM should be launched in spawn mode
|
void |
setSystemProperty(String name,
String value)
Sets a system property for the JVM.
|
void |
setTimeout(long millis)
Sets the timeout in milliseconds after which the process will be killed if still running.
|
void |
setWorkingDirectory(File workingDirectory)
Sets the working directory for the forked JVM.
|
void |
start()
Launches a JVM according to the configuration of this launcher.
|
void setWorkingDirectory(File workingDirectory)
workingDirectory - The working directory for the forked JVM, may be null.void setJvm(String command)
command - The command to lauch the JVM, may be null.void addJvmArgument(File file)
file - The pathname to add, may be null.void addJvmArguments(String... values)
values - The values to add, may be null.void addJvmArgumentLine(String line)
line - The arguments to add, may be be null.void addClasspathEntries(String... paths)
paths - The classpath entries, may be null.void addClasspathEntries(File... paths)
paths - The classpath entries, may be null.String getClasspath()
null.void setSystemProperty(String name, String value)
name - The property name, may be null.value - The property value, may be null.void setJarFile(File jarFile)
setJarFile(File)
and setMainClass(String) may be invoked.jarFile - The JAR file to execute, may be null.void setMainClass(String mainClass)
setJarFile(File)
and setMainClass(String) may be invoked.mainClass - The qualified name of the Java class to execute, may be null.void addAppArgument(File file)
file - The pathname to add, may be null.void addAppArguments(String... values)
values - The values to add, may be null.void addAppArgumentLine(String line)
line - The arguments to add, may be null.void setOutputFile(File outputFile)
outputFile - The file to which the output of the JVM is redirected, may be null.void setAppendOutput(boolean appendOutput)
appendOutput - true to append the output, false to overwrite the file.setOutputFile(File)String getCommandLine()
null.void kill()
void setTimeout(long millis)
millis - The timeout, may be non-positive to disable process watching.void setSpawn(boolean spawn)
spawn - true to launch JVM in spawn, false to launch normal JVM.void start()
throws JvmLauncherException
JvmLauncherException - If the JVM could not be launched.int execute()
throws JvmLauncherException
JvmLauncherException - If the JVM could not be launched.Copyright © 2004-2013 Codehaus. All Rights Reserved.