@PublicAPI public class ForkEnvironment extends Object implements Serializable
javaHome
, javaArguments
, classpath
, ...Constructor and Description |
---|
ForkEnvironment() |
ForkEnvironment(ForkEnvironment forkEnvironment)
Copy constructor.
|
ForkEnvironment(String workingDir) |
Modifier and Type | Method and Description |
---|---|
void |
addAdditionalClasspath(String... values) |
void |
addAdditionalClasspath(String value)
Add a new additional Classpath value.
|
void |
addJVMArgument(String value)
Add a new JVM argument value.
|
String |
addSystemEnvironmentVariable(String name,
String value)
Add a new system environment variables value from its name and value.
|
List<String> |
getAdditionalClasspath()
Return a copy of the additional classpath, empty list if no arguments.
|
Script<?> |
getEnvScript()
Get the environment script.
|
String |
getJavaHome()
Returns the javaHome.
|
List<String> |
getJVMArguments()
Return a copy of the JVM arguments, empty list if no arguments.
|
Map<String,String> |
getSystemEnvironment()
Return a copy of the system environment, empty map if no variables.
|
String |
getSystemEnvironmentVariable(String name)
Get the system environment variable value associated with the given name.
|
String |
getWorkingDir()
Return the working Directory.
|
void |
setEnvScript(Script<?> script)
Set the environment script value to the given script value.
|
void |
setJavaHome(String javaHome)
Sets the javaHome to the given javaHome value.
|
void |
setWorkingDir(String workingDir)
Set the working directory value to the given workingDir value.
|
String |
toString() |
public ForkEnvironment()
public ForkEnvironment(ForkEnvironment forkEnvironment) throws ExecutableCreationException
forkEnvironment
- the object to copyExecutableCreationException
- script copy failedpublic ForkEnvironment(String workingDir)
public String getJavaHome()
public void setJavaHome(String javaHome)
javaHome
- the javaHome to set.public String getWorkingDir()
public void setWorkingDir(String workingDir)
workingDir
- the working directory to setpublic Map<String,String> getSystemEnvironment()
public String getSystemEnvironmentVariable(String name)
name
- the name of the variable value to getnull
if the variable does not exist.public String addSystemEnvironmentVariable(String name, String value)
name
- the name of the variable to addvalue
- the the value associated to the given nameIllegalArgumentException
- if name is nullpublic List<String> getJVMArguments()
public void addJVMArgument(String value)
value
- the value of the property to be added.IllegalArgumentException
- if value is null.public List<String> getAdditionalClasspath()
public void addAdditionalClasspath(String... values)
public void addAdditionalClasspath(String value)
value
- the additional Classpath to add.IllegalArgumentException
- if value is null.public Script<?> getEnvScript()
public void setEnvScript(Script<?> script)
This script allows the user to programmatically set system variables, JVM arguments, additional classpath, etc.
Use the binding variable name forkEnvironment
to fill this object in this given script.
script
- the script to set