java.lang.Object
org.wildfly.core.launcher.BootableJarCommandBuilder
- All Implemented Interfaces:
CommandBuilder
Builds a list of commands used to launch a bootable jar instance of WildFly.
This builder is not thread safe and the same instance should not be used in multiple threads.
- Author:
- JF Denise
-
Method Summary
Modifier and TypeMethodDescriptionaddJavaOption(String jvmArg) Adds a JVM argument to the command ignoringnullarguments.addJavaOptions(Iterable<String> javaOpts) Adds the collection of JVM arguments to the command.addJavaOptions(String... javaOpts) Adds the array of JVM arguments to the command.addSecurityProperties(Map<String, String> properties) Adds all the security properties to be passed to the server.Adds a security property to be passed to the server with anullvalue.addSecurityProperty(String key, String value) Adds a security property to be passed to the server.addServerArgument(String arg) Adds an argument to be passed to the server ignore the argument ifnull.addServerArguments(Iterable<String> args) Adds the arguments to the collection of arguments that will be passed to the server ignoring anynullarguments.addServerArguments(String... args) Adds the arguments to the collection of arguments that will be passed to the server ignoring anynullarguments.build()A list of commands, including ajavaexecutable, required to launch WildFly instance.A list of command arguments required to launch WildFly instance.Returns the Java home directory where the java executable command can be found.Returns the JVM arguments.A collection of server command line arguments.static BootableJarCommandBuilderCreates a command builder for a bootable instance of WildFly.static BootableJarCommandBuilderCreates a command builder for a bootable instance of WildFly.setBindAddressHint(String address) Sets the system propertyjboss.bind.addressto the address given.setBindAddressHint(String interfaceName, String address) Sets the system propertyjboss.bind.address.$INTERFACEto the address given where$INTERFACEis theinterfaceNameparameter.setDebug()Sets the debug argument for the JVM with a default port of8787.setDebug(boolean suspend, int port) Sets the debug JPDA remote socket debugging argument.setDebug(int port) Sets the debug argument for the JVM.setInstallDir(Path installDir) Set the directory to install the server.setJavaHome(String javaHome) Sets the Java home where the Java executable can be found.setJavaHome(Path javaHome) Sets the Java home where the Java executable can be found.setJavaOptions(Iterable<String> javaOpts) Sets the JVM arguments to use.setJavaOptions(String... javaOpts) Sets the JVM arguments to use.setModulesLockless(boolean b) Set totrueto use JBoss Modules lockless mode.setModulesMetrics(boolean b) Set totrueto gather metrics for JBoss Modules.setMulticastAddressHint(String address) Sets the system propertyjboss.default.multicast.addressto the address given.setYamlFiles(Path... yamlFiles) Adds the YAML configuration file argument with the given YAML configuration files.setYamlFiles(Collection<Path> yamlFiles) Adds the YAML configuration file argument with the given YAML configuration files.
-
Method Details
-
setInstallDir
Set the directory to install the server.- Parameters:
installDir- Installation directory.- Returns:
- This builder.
-
getServerArguments
A collection of server command line arguments.- Returns:
- the server arguments
-
addServerArguments
Adds the arguments to the collection of arguments that will be passed to the server ignoring anynullarguments.- Parameters:
args- the arguments to add- Returns:
- the builder
-
addServerArguments
Adds the arguments to the collection of arguments that will be passed to the server ignoring anynullarguments.- Parameters:
args- the arguments to add- Returns:
- the builder
-
addServerArgument
Adds an argument to be passed to the server ignore the argument ifnull.- Parameters:
arg- the argument to pass- Returns:
- the builder
-
setBindAddressHint
Sets the system propertyjboss.bind.addressto the address given. This will override any previous value set viaaddServerArgument(String). Note: This option only works if the standard system property has not been removed from the interface. If the system property was removed the address provided has no effect.- Parameters:
address- the address to set the bind address to- Returns:
- the builder
-
setBindAddressHint
Sets the system propertyjboss.bind.address.$INTERFACEto the address given where$INTERFACEis theinterfaceNameparameter. For example in the default configuration passingmanagementfor theinterfaceNameparameter would result in the system propertyjboss.bind.address.managementbeing set to the address provided. This will override any previous value set viaaddServerArgument(String). Note: This option only works if the standard system property has not been removed from the interface. If the system property was removed the address provided has no effect.- Parameters:
interfaceName- the name of the interface of the binding addressaddress- the address to bind the management interface to- Returns:
- the builder
-
setMulticastAddressHint
Sets the system propertyjboss.default.multicast.addressto the address given. This will override any previous value set viaaddServerArgument(String). Note: This option only works if the standard system property has not been removed from the interface. If the system property was removed the address provided has no effect.- Parameters:
address- the address to set the multicast system property to- Returns:
- the builder
-
of
Creates a command builder for a bootable instance of WildFly.- Parameters:
bootableJar- the path to the bootable jar- Returns:
- a new builder
-
of
Creates a command builder for a bootable instance of WildFly.- Parameters:
bootableJar- the path to the WildFly home directory- Returns:
- a new builder
-
addJavaOption
Adds a JVM argument to the command ignoringnullarguments.- Parameters:
jvmArg- the JVM argument to add- Returns:
- the builder
-
setYamlFiles
Adds the YAML configuration file argument with the given YAML configuration files.- Parameters:
yamlFiles- the files to add- Returns:
- the builder
-
setYamlFiles
Adds the YAML configuration file argument with the given YAML configuration files.- Parameters:
yamlFiles- the files to add- Returns:
- the builder
-
addJavaOptions
Adds the array of JVM arguments to the command.- Parameters:
javaOpts- the array of JVM arguments to add,nullarguments are ignored- Returns:
- the builder
-
addJavaOptions
Adds the collection of JVM arguments to the command.- Parameters:
javaOpts- the collection of JVM arguments to add,nullarguments are ignored- Returns:
- the builder
-
setJavaOptions
Sets the JVM arguments to use. This overrides any default JVM arguments that would normally be added and ignoresnullvalues in the collection. If the collection isnullthe JVM arguments will be cleared and no new arguments will be added.- Parameters:
javaOpts- the JVM arguments to use- Returns:
- the builder
-
setJavaOptions
Sets the JVM arguments to use. This overrides any default JVM arguments that would normally be added and ignoresnullvalues in the array. If the array isnullthe JVM arguments will be cleared and no new arguments will be added.- Parameters:
javaOpts- the JVM arguments to use- Returns:
- the builder
-
getJavaOptions
Returns the JVM arguments.- Returns:
- the JVM arguments
-
setDebug
Sets the debug argument for the JVM with a default port of8787.- Returns:
- the builder
-
setDebug
Sets the debug argument for the JVM.- Parameters:
port- the port to listen on- Returns:
- the builder
-
setDebug
Sets the debug JPDA remote socket debugging argument.- Parameters:
suspend-trueto suspend otherwisefalseport- the port to listen on- Returns:
- the builder
-
setJavaHome
Sets the Java home where the Java executable can be found.- Parameters:
javaHome- the Java home ornullto use te system propertyjava.home- Returns:
- the builder
-
setJavaHome
Sets the Java home where the Java executable can be found.- Parameters:
javaHome- the Java home ornullto use te system propertyjava.home- Returns:
- the builder
-
setModulesLockless
Set totrueto use JBoss Modules lockless mode.- Parameters:
b-trueto use lockless mode- Returns:
- the builder
-
setModulesMetrics
Set totrueto gather metrics for JBoss Modules.- Parameters:
b-trueto gather metrics for JBoss Modules.- Returns:
- this builder
-
addSecurityProperty
Adds a security property to be passed to the server with anullvalue.- Parameters:
key- the property key- Returns:
- the builder
-
addSecurityProperty
Adds a security property to be passed to the server.- Parameters:
key- the property keyvalue- the property value- Returns:
- the builder
-
addSecurityProperties
Adds all the security properties to be passed to the server.- Parameters:
properties- a map of the properties to add,nullvalues are allowed in the map- Returns:
- the builder
-
buildArguments
Description copied from interface:CommandBuilderA list of command arguments required to launch WildFly instance. These are the arguments the follow ajavaexecutable command.- Specified by:
buildArgumentsin interfaceCommandBuilder- Returns:
- the list of arguments required to launch WildFly
-
build
Description copied from interface:CommandBuilderA list of commands, including ajavaexecutable, required to launch WildFly instance.- Specified by:
buildin interfaceCommandBuilder- Returns:
- the list of arguments required to launch WildFly
-
getJavaHome
Returns the Java home directory where the java executable command can be found. If the directory was not set the system property value,java.home, should be used.- Returns:
- the path to the Java home directory
-