- java.lang.Object
-
- org.wildfly.core.launcher.JBossModulesCommandBuilder
-
- org.wildfly.core.launcher.DomainCommandBuilder
-
- All Implemented Interfaces:
CommandBuilder
public class DomainCommandBuilder extends JBossModulesCommandBuilder implements CommandBuilder
Builds a list of commands used to launch a domain instance of WildFly. This builder is not thread safe and the same instance should not be used in multiple threads. Thedefault Java homedirectory is used for the process controller and optionally for the host controller and the servers launched.- Author:
- James R. Perkins
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description DomainCommandBuilderaddHostControllerJavaOption(String arg)Adds a JVM argument to the host controller ignoringnullvalues.DomainCommandBuilderaddHostControllerJavaOptions(Iterable<String> args)Adds a JVM arguments to the host controller ignoringnullvalues.DomainCommandBuilderaddHostControllerJavaOptions(String... args)Adds a JVM arguments to the host controller ignoringnullvalues.TaddModuleDir(String moduleDir)Adds a directory to the collection of module paths.TaddModuleDirs(Iterable<String> moduleDirs)Adds all the module directories to the collection of module paths.TaddModuleDirs(String... moduleDirs)Adds all the module directories to the collection of module paths.DomainCommandBuilderaddProcessControllerJavaOption(String arg)Adds a JVM argument to the process controller ignoringnullvalues.DomainCommandBuilderaddProcessControllerJavaOptions(Iterable<String> args)Adds a JVM arguments to the process controller ignoringnullvalues.DomainCommandBuilderaddProcessControllerJavaOptions(String... args)Adds a JVM arguments to the process controller ignoringnullvalues.TaddPropertiesFile(String file)Adds a properties file to be passed to the server.TaddPropertiesFile(Path file)Adds a properties file to be passed to the server.TaddServerArgument(String arg)Adds an argument to be passed to the server ignore the argument ifnull.TaddServerArguments(Iterable<String> args)Adds the arguments to the collection of arguments that will be passed to the server ignoring anynullarguments.TaddServerArguments(String... args)Adds the arguments to the collection of arguments that will be passed to the server ignoring anynullarguments.protected static voidaddSystemPropertyArg(List<String> cmd, String key, Object value)List<String>buildArguments()A list of command arguments required to launch WildFly instance.PathgetBaseDirectory()Returns the base directory for the server.protected StringgetBootLogArgument(String fileName)Returns the command line argument that specifies the path the log file that should be used.PathgetConfigurationDirectory()Returns the configuration directory for the server.StringgetDomainConfiguration()Returns the configuration filesetornullif one was not set.StringgetHostConfiguration()Returns the configuration filesetornullif one was not set.PathgetHostControllerJavaHome()Returns the Java home path the host controller will use.List<String>getHostControllerJavaOptions()Returns the JVM arguments for the host controller.PathgetJavaHome()Returns the Java home directory where the java executable command can be found.PathgetLogDirectory()Returns the log directory for the server.protected StringgetLoggingPropertiesArgument(String fileName)Returns the command line argument that specifies the logging configuration.List<String>getProcessControllerJavaOptions()Returns the JVM arguments used for the process controller.StringgetReadOnlyDomainConfiguration()Returns the configuration filesetReadOnlyDomainConfiguration(String)set} ornullif one was not set.StringgetReadOnlyHostConfiguration()Returns the configuration filesetReadOnlyHostConfiguration(String)set} ornullif one was not set.PathgetServerJavaHome()Returns the Java home path the servers will use.protected DomainCommandBuildergetThis()Returns the concrete builder.protected PathnormalizePath(String path)Resolves the path to the path relative to the WildFly home directory.protected PathnormalizePath(Path parent, String path)Resolves the path relative to the parent and normalizes it.static DomainCommandBuilderof(String wildflyHome)Creates a command builder for a domain instance of WildFly.static DomainCommandBuilderof(String wildflyHome, String javaHome)Creates a command builder for a domain instance of WildFly.static DomainCommandBuilderof(Path wildflyHome)Creates a command builder for a domain instance of WildFly.static DomainCommandBuilderof(Path wildflyHome, Path javaHome)Creates a command builder for a domain instance of WildFly.TsetAdminOnly()Sets the server argument--admin-only.DomainCommandBuildersetBackup()Sets the option (--backupto keep a copy of the persistent domain configuration even if this host is not a domain controller.DomainCommandBuildersetBaseDirectory(String baseDir)Sets the base directory to use.DomainCommandBuildersetBaseDirectory(Path baseDir)Sets the base directory to use.TsetBindAddressHint(String address)Sets the system propertyjboss.bind.addressto the address given.TsetBindAddressHint(String interfaceName, String address)Sets the system propertyjboss.bind.address.$INTERFACEto the address given where$INTERFACEis theinterfaceNameparameter.DomainCommandBuildersetCachedDomainController()Sets the option (--cached-dc) to boot using a locally cached copy of the domain configuration.TsetConfigurationDirectory(String path)Sets the configuration directory to be used for configuration files.TsetConfigurationDirectory(Path path)Sets the configuration directory to be used for configuration files.DomainCommandBuildersetDomainConfiguration(String configFile)Sets the configuration file for the domain (domain.xml).DomainCommandBuildersetHostConfiguration(String configFile)Sets the configuration file for the host controller (host.xml).DomainCommandBuildersetHostControllerJavaHome(String javaHome)Sets the Java home for the host controller.DomainCommandBuildersetHostControllerJavaHome(Path javaHome)Sets the Java home for the host controller.DomainCommandBuildersetHostControllerJavaOptions(Iterable<String> args)Sets the JVM arguments for the host controller ignoringnullvalues in the collection.DomainCommandBuildersetHostControllerJavaOptions(String... args)Sets the JVM arguments for the host controller ignoringnullvalues in the array.DomainCommandBuildersetInterProcessHostControllerAddress(String address)Sets the address on which the host controller should listen for communication from the process controller (interprocess-hc-address).DomainCommandBuildersetInterProcessHostControllerPort(int port)Sets the port on which the host controller should listen for communication from the process controller (interprocess-hc-address).DomainCommandBuildersetInterProcessHostControllerPort(String port)Sets the port on which the host controller should listen for communication from the process controller (interprocess-hc-address).TsetLogDirectory(String path)Sets the log directory to be used for log files.TsetLogDirectory(Path path)Sets the log directory to be used for log files.DomainCommandBuildersetMasterAddressHint(String address)Sets the system propertyjboss.domain.primary.address.DomainCommandBuildersetMasterPortHint(int port)Sets the system propertyjboss.domain.primary.port.DomainCommandBuildersetMasterPortHint(String port)Sets the system propertyjboss.domain.primary.port.TsetModuleDirs(Iterable<String> moduleDirs)Replaces any previously set module directories with the collection of module directories.TsetModuleDirs(String... moduleDirs)Replaces any previously set module directories with the array of module directories.TsetMulticastAddressHint(String address)Sets the system propertyjboss.default.multicast.addressto the address given.DomainCommandBuildersetProcessControllerAddress(String address)Sets the address on which the process controller listens for communication from processes it controls.DomainCommandBuildersetProcessControllerJavaOptions(Iterable<String> args)Sets the JVM arguments for the process controller ignoringnullvalues in the collection.DomainCommandBuildersetProcessControllerJavaOptions(String... args)Sets the JVM arguments for the process controller ignoringnullvalues in the array.DomainCommandBuildersetProcessControllerPort(int port)Sets the port on which the process controller listens for communication from processes it controls.DomainCommandBuildersetProcessControllerPort(String port)Sets the port on which the process controller listens for communication from processes it controls.TsetPropertiesFile(String file)Sets the properties file to use for the server ornullto remove the file.TsetPropertiesFile(Path file)Sets the properties file to use for the server ornullto remove the file.DomainCommandBuildersetReadOnlyDomainConfiguration(String configFile)Sets the read only configuration file for the domain (domain.xml).DomainCommandBuildersetReadOnlyHostConfiguration(String configFile)Sets the read only configuration file for the host controller (host.xml).DomainCommandBuildersetServerJavaHome(String javaHome)Sets the Java home for the servers that are launched in the domain.DomainCommandBuildersetServerJavaHome(Path javaHome)Sets the Java home for the servers that are launched in the domain.DomainCommandBuildersetStability(String stability)Sets the stability level of the standalone server process.TsetStartSuspended()Sets the server argument--start-mode=suspend.TsetUseSecurityManager(boolean useSecMgr)Sets whether or not the security manager option,-secmgr, should be used.-
Methods inherited from class org.wildfly.core.launcher.JBossModulesCommandBuilder
addJavaOption, addJavaOptions, addJavaOptions, addModuleOption, addModuleOptions, addModuleOptions, addServerArg, build, getJavaOptions, getModulePaths, getModulesJarName, getServerArg, getServerArguments, getWildFlyHome, of, setJavaHome, setJavaHome, setJavaOptions, setJavaOptions, setModuleOptions, setModuleOptions, setModulesLockless, setModulesMetrics, setSingleServerArg, useSecurityManager
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.wildfly.core.launcher.CommandBuilder
build
-
-
-
-
Method Detail
-
of
public static DomainCommandBuilder of(Path wildflyHome)
Creates a command builder for a domain instance of WildFly. Uses the system propertyjava.hometo find the java executable required for the default Java home.- Parameters:
wildflyHome- the path to the WildFly home directory- Returns:
- a new builder
-
of
public static DomainCommandBuilder of(String wildflyHome)
Creates a command builder for a domain instance of WildFly. Uses the system propertyjava.hometo find the java executable required for the default Java home.- Parameters:
wildflyHome- the path to the WildFly home directory- Returns:
- a new builder
-
of
public static DomainCommandBuilder of(String wildflyHome, String javaHome)
Creates a command builder for a domain instance of WildFly.- Parameters:
wildflyHome- the path to the WildFly home directoryjavaHome- the path to the default Java home directory- Returns:
- a new builder
-
of
public static DomainCommandBuilder of(Path wildflyHome, Path javaHome)
Creates a command builder for a domain instance of WildFly.- Parameters:
wildflyHome- the path to the WildFly home directoryjavaHome- the path default to the Java home directory- Returns:
- a new builder
-
setBackup
public DomainCommandBuilder setBackup()
Sets the option (--backupto keep a copy of the persistent domain configuration even if this host is not a domain controller.- Returns:
- the builder
-
setCachedDomainController
public DomainCommandBuilder setCachedDomainController()
Sets the option (--cached-dc) to boot using a locally cached copy of the domain configuration.- Returns:
- the builder
- See Also:
setBackup()
-
setInterProcessHostControllerAddress
public DomainCommandBuilder setInterProcessHostControllerAddress(String address)
Sets the address on which the host controller should listen for communication from the process controller (interprocess-hc-address). Ignoresnullvalues.- Parameters:
address- the address- Returns:
- the builder
-
setInterProcessHostControllerPort
public DomainCommandBuilder setInterProcessHostControllerPort(String port)
Sets the port on which the host controller should listen for communication from the process controller (interprocess-hc-address). Ignoresnullvalues or values less than 0.- Parameters:
port- the port- Returns:
- the builder
- Throws:
NumberFormatException- if the port is not a valid integer
-
setInterProcessHostControllerPort
public DomainCommandBuilder setInterProcessHostControllerPort(int port)
Sets the port on which the host controller should listen for communication from the process controller (interprocess-hc-address). Ignores values less than 0.- Parameters:
port- the port- Returns:
- the builder
-
setMasterAddressHint
public DomainCommandBuilder setMasterAddressHint(String address)
Sets the system propertyjboss.domain.primary.address. In a default slave host configuration this is used to configure the address of the master host controller. Ignoresnullvalues. Note: This option only works if the standard system property has not been removed from the remote host. If the system property was removed the address provided has no effect.- Parameters:
address- the address- Returns:
- the builder
-
setMasterPortHint
public DomainCommandBuilder setMasterPortHint(String port)
Sets the system propertyjboss.domain.primary.port. In a default slave host configuration this is used to configure the port of the master host controller. Ignoresnullvalues or values less than 0. Note: This option only works if the standard system property has not been removed from the remote host. If the system property was removed the port provided has no effect.- Parameters:
port- the port- Returns:
- the builder
- Throws:
NumberFormatException- if the port is not a valid integer
-
setMasterPortHint
public DomainCommandBuilder setMasterPortHint(int port)
Sets the system propertyjboss.domain.primary.port. In a default slave host configuration this is used to configure the port of the master host controller. Ignores values less than 0. Note: This option only works if the standard system property has not been removed from the remote host. If the system property was removed the port provided has no effect.- Parameters:
port- the port- Returns:
- the builder
-
setProcessControllerAddress
public DomainCommandBuilder setProcessControllerAddress(String address)
Sets the address on which the process controller listens for communication from processes it controls. Ignoresnullvalues.- Parameters:
address- the address- Returns:
- the builder
-
setProcessControllerPort
public DomainCommandBuilder setProcessControllerPort(String port)
Sets the port on which the process controller listens for communication from processes it controls. Ignoresnullvalues or values less than 0.- Parameters:
port- the port- Returns:
- the builder
- Throws:
NumberFormatException- if the port is not a valid integer
-
setProcessControllerPort
public DomainCommandBuilder setProcessControllerPort(int port)
Sets the port on which the process controller listens for communication from processes it controls. Ignores values less than 0.- Parameters:
port- the port- Returns:
- the builder
-
setBaseDirectory
public DomainCommandBuilder setBaseDirectory(String baseDir)
Sets the base directory to use. The default is$JBOSS_HOME/standalone.- Parameters:
baseDir- the base directory ornullto resolve the base directory- Returns:
- the builder
-
setBaseDirectory
public DomainCommandBuilder setBaseDirectory(Path baseDir)
Sets the base directory to use. The default is$JBOSS_HOME/standalone.- Parameters:
baseDir- the base directory ornullto resolve the base directory- Returns:
- the builder
-
setHostControllerJavaHome
public DomainCommandBuilder setHostControllerJavaHome(String javaHome)
Sets the Java home for the host controller. If thejavaHomeis notnullthen the java executable will be resolved and used to launch the host processor. If thejavaHomeisnullthe same java executable will be used to launch the host controller that launched the process controller.- Parameters:
javaHome- the java home to set, can benullto use the default- Returns:
- the builder
-
setHostControllerJavaHome
public DomainCommandBuilder setHostControllerJavaHome(Path javaHome)
Sets the Java home for the host controller. If thejavaHomeis notnullthen the java executable will be resolved and used to launch the host processor. If thejavaHomeisnullthe same java executable will be used to launch the host controller that launched the process controller.- Parameters:
javaHome- the java home to set, can benullto use the default- Returns:
- the builder
-
getHostControllerJavaHome
public Path getHostControllerJavaHome()
Returns the Java home path the host controller will use.- Returns:
- the path to the Java home for the host controller
-
setHostConfiguration
public DomainCommandBuilder setHostConfiguration(String configFile)
Sets the configuration file for the host controller (host.xml). The file must be in theconfigurationdirectory. A value ofnullis ignored.- Parameters:
configFile- the configuration file name- Returns:
- the builder
-
getHostConfiguration
public String getHostConfiguration()
Returns the configuration filesetornullif one was not set.- Returns:
- the configuration file set or
nullif not set
-
setReadOnlyHostConfiguration
public DomainCommandBuilder setReadOnlyHostConfiguration(String configFile)
Sets the read only configuration file for the host controller (host.xml). The file must be in theconfigurationdirectory. A value ofnullis ignored This will override any previous value set.- Parameters:
configFile- the configuration file name ornull- Returns:
- the builder
-
getReadOnlyHostConfiguration
public String getReadOnlyHostConfiguration()
Returns the configuration filesetReadOnlyHostConfiguration(String)set} ornullif one was not set.- Returns:
- the configuration file set or
nullif not set
-
setDomainConfiguration
public DomainCommandBuilder setDomainConfiguration(String configFile)
Sets the configuration file for the domain (domain.xml). The file must be in theconfigurationdirectory. A value ofnullis ignored. This will override any previous value set.- Parameters:
configFile- the configuration file name- Returns:
- the builder
-
getDomainConfiguration
public String getDomainConfiguration()
Returns the configuration filesetornullif one was not set.- Returns:
- the configuration file set or
nullif not set
-
setReadOnlyDomainConfiguration
public DomainCommandBuilder setReadOnlyDomainConfiguration(String configFile)
Sets the read only configuration file for the domain (domain.xml). The file must be in theconfigurationdirectory. A value ofnullis ignored This will override any previous value set.- Parameters:
configFile- the configuration file name ornull- Returns:
- the builder
-
getReadOnlyDomainConfiguration
public String getReadOnlyDomainConfiguration()
Returns the configuration filesetReadOnlyDomainConfiguration(String)set} ornullif one was not set.- Returns:
- the configuration file set or
nullif not set
-
addHostControllerJavaOption
public DomainCommandBuilder addHostControllerJavaOption(String arg)
Adds a JVM argument to the host controller ignoringnullvalues.- Parameters:
arg- the argument to add- Returns:
- the builder
-
addHostControllerJavaOptions
public DomainCommandBuilder addHostControllerJavaOptions(String... args)
Adds a JVM arguments to the host controller ignoringnullvalues.- Parameters:
args- the arguments to add- Returns:
- the builder
-
addHostControllerJavaOptions
public DomainCommandBuilder addHostControllerJavaOptions(Iterable<String> args)
Adds a JVM arguments to the host controller ignoringnullvalues.- Parameters:
args- the arguments to add- Returns:
- the builder
-
setHostControllerJavaOptions
public DomainCommandBuilder setHostControllerJavaOptions(String... args)
Sets the JVM arguments for the host controller ignoringnullvalues in the array. If the array isnullthe host controller JVM arguments are cleared and no new ones are added- Parameters:
args- the arguments to add- Returns:
- the builder
-
setHostControllerJavaOptions
public DomainCommandBuilder setHostControllerJavaOptions(Iterable<String> args)
Sets the JVM arguments for the host controller ignoringnullvalues in the collection. If the collection isnullthe host controller JVM arguments are cleared and no new ones are added- Parameters:
args- the arguments to add- Returns:
- the builder
-
getHostControllerJavaOptions
public List<String> getHostControllerJavaOptions()
Returns the JVM arguments for the host controller.- Returns:
- the JVM arguments
-
addProcessControllerJavaOption
public DomainCommandBuilder addProcessControllerJavaOption(String arg)
Adds a JVM argument to the process controller ignoringnullvalues.- Parameters:
arg- the argument to add- Returns:
- the builder
-
addProcessControllerJavaOptions
public DomainCommandBuilder addProcessControllerJavaOptions(String... args)
Adds a JVM arguments to the process controller ignoringnullvalues.- Parameters:
args- the arguments to add- Returns:
- the builder
-
addProcessControllerJavaOptions
public DomainCommandBuilder addProcessControllerJavaOptions(Iterable<String> args)
Adds a JVM arguments to the process controller ignoringnullvalues.- Parameters:
args- the arguments to add- Returns:
- the builder
-
setProcessControllerJavaOptions
public DomainCommandBuilder setProcessControllerJavaOptions(String... args)
Sets the JVM arguments for the process controller ignoringnullvalues in the array. If the array isnullthe process controller JVM arguments are cleared and no new ones are added- Parameters:
args- the arguments to add- Returns:
- the builder
-
setProcessControllerJavaOptions
public DomainCommandBuilder setProcessControllerJavaOptions(Iterable<String> args)
Sets the JVM arguments for the process controller ignoringnullvalues in the collection. If the collection isnullthe process controller JVM arguments are cleared and no new ones are added- Parameters:
args- the arguments to add- Returns:
- the builder
-
getProcessControllerJavaOptions
public List<String> getProcessControllerJavaOptions()
Returns the JVM arguments used for the process controller.- Returns:
- the JVM arguments
-
setServerJavaHome
public DomainCommandBuilder setServerJavaHome(String javaHome)
Sets the Java home for the servers that are launched in the domain. If thejavaHomeis notnullthen the java executable will be resolved and used to launch the servers in the domain. If thejavaHomeisnullthe same java executable will be used to launch the servers in the domain that launched the process controller.- Parameters:
javaHome- the java home to set, can benullto use the default- Returns:
- the builder
-
setServerJavaHome
public DomainCommandBuilder setServerJavaHome(Path javaHome)
Sets the Java home for the servers that are launched in the domain. If thejavaHomeis notnullthen the java executable will be resolved and used to launch the servers in the domain. If thejavaHomeisnullthe same java executable will be used to launch the servers in the domain that launched the process controller.- Parameters:
javaHome- the java home to set, can benullto use the default- Returns:
- the builder
-
setStability
public DomainCommandBuilder setStability(String stability)
Sets the stability level of the standalone server process.- Parameters:
stability- a stability level- Returns:
- a reference to this builder
-
getServerJavaHome
public Path getServerJavaHome()
Returns the Java home path the servers will use.- Returns:
- the path to the Java home for the servers
-
buildArguments
public List<String> 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- Overrides:
buildArgumentsin classJBossModulesCommandBuilder- Returns:
- the list of arguments required to launch WildFly
-
getJavaHome
public Path 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
-
getBaseDirectory
public Path getBaseDirectory()
Returns the base directory for the server. Example: For standalone the base directory would be$JBOSS_HOME/standalone.- Returns:
- the base directory
-
getThis
protected DomainCommandBuilder getThis()
Returns the concrete builder.- Returns:
- the concrete builder
-
setUseSecurityManager
public T setUseSecurityManager(boolean useSecMgr)
Description copied from class:JBossModulesCommandBuilderSets whether or not the security manager option,-secmgr, should be used.- Overrides:
setUseSecurityManagerin classJBossModulesCommandBuilder- Parameters:
useSecMgr-trueto use the a security manager, otherwisefalse- Returns:
- the builder
-
addModuleDir
public T addModuleDir(String moduleDir)
Description copied from class:JBossModulesCommandBuilderAdds a directory to the collection of module paths.- Overrides:
addModuleDirin classJBossModulesCommandBuilder- Parameters:
moduleDir- the module directory to add- Returns:
- the builder
-
addModuleDirs
public T addModuleDirs(String... moduleDirs)
Description copied from class:JBossModulesCommandBuilderAdds all the module directories to the collection of module paths.- Overrides:
addModuleDirsin classJBossModulesCommandBuilder- Parameters:
moduleDirs- an array of module paths to add- Returns:
- the builder
-
addModuleDirs
public T addModuleDirs(Iterable<String> moduleDirs)
Description copied from class:JBossModulesCommandBuilderAdds all the module directories to the collection of module paths.- Overrides:
addModuleDirsin classJBossModulesCommandBuilder- Parameters:
moduleDirs- a collection of module paths to add- Returns:
- the builder
-
setModuleDirs
public T setModuleDirs(Iterable<String> moduleDirs)
Description copied from class:JBossModulesCommandBuilderReplaces any previously set module directories with the collection of module directories. The default module directory will NOT be used if this method is invoked.- Overrides:
setModuleDirsin classJBossModulesCommandBuilder- Parameters:
moduleDirs- the collection of module directories to use- Returns:
- the builder
-
setModuleDirs
public T setModuleDirs(String... moduleDirs)
Description copied from class:JBossModulesCommandBuilderReplaces any previously set module directories with the array of module directories. The default module directory will NOT be used if this method is invoked.- Overrides:
setModuleDirsin classJBossModulesCommandBuilder- Parameters:
moduleDirs- the array of module directories to use- Returns:
- the builder
-
getLogDirectory
public Path getLogDirectory()
Returns the log directory for the server.- Returns:
- the log directory
-
setLogDirectory
public T setLogDirectory(String path)
Sets the log directory to be used for log files. If set tonull, the default, the log directory will be resolved.- Parameters:
path- the path to the log directory ornullto have the log directory resolved- Returns:
- the builder
- Throws:
IllegalArgumentException- if the directory is not a valid directory
-
setLogDirectory
public T setLogDirectory(Path path)
Sets the log directory to be used for log files. If set tonull, the default, the log directory will be resolved.- Parameters:
path- the path to the log directory ornullto have the log directory resolved- Returns:
- the builder
- Throws:
IllegalArgumentException- if the directory is not a valid directory
-
getConfigurationDirectory
public Path getConfigurationDirectory()
Returns the configuration directory for the server.- Returns:
- the configuration directory
-
setConfigurationDirectory
public T setConfigurationDirectory(String path)
Sets the configuration directory to be used for configuration files. If set tonull, the default, the configuration directory will be resolved.- Parameters:
path- the path to the configuration directory ornullto have the configuration directory resolved- Returns:
- the builder
- Throws:
IllegalArgumentException- if the directory is not a valid directory
-
setConfigurationDirectory
public T setConfigurationDirectory(Path path)
Sets the configuration directory to be used for configuration files. If set tonull, the default, the configuration directory will be resolved.- Parameters:
path- the path to the configuration directory ornullto have the configuration directory resolved- Returns:
- the builder
- Throws:
IllegalArgumentException- if the directory is not a valid directory
-
addServerArgument
public T addServerArgument(String arg)
Description copied from class:JBossModulesCommandBuilderAdds an argument to be passed to the server ignore the argument ifnull.- Overrides:
addServerArgumentin classJBossModulesCommandBuilder- Parameters:
arg- the argument to pass- Returns:
- the builder
-
addServerArguments
public T addServerArguments(String... args)
Description copied from class:JBossModulesCommandBuilderAdds the arguments to the collection of arguments that will be passed to the server ignoring anynullarguments.- Overrides:
addServerArgumentsin classJBossModulesCommandBuilder- Parameters:
args- the arguments to add- Returns:
- the builder
-
addServerArguments
public T addServerArguments(Iterable<String> args)
Description copied from class:JBossModulesCommandBuilderAdds the arguments to the collection of arguments that will be passed to the server ignoring anynullarguments.- Overrides:
addServerArgumentsin classJBossModulesCommandBuilder- Parameters:
args- the arguments to add- Returns:
- the builder
-
setAdminOnly
public T setAdminOnly()
Sets the server argument--admin-only.- Returns:
- the builder
-
setStartSuspended
public T setStartSuspended()
Sets the server argument--start-mode=suspend.- Returns:
- the builder
-
setBindAddressHint
public T setBindAddressHint(String address)
Sets the system propertyjboss.bind.addressto the address given. This will override any previous value set viaJBossModulesCommandBuilder.addServerArgument(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
public T setBindAddressHint(String interfaceName, String address)
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 viaJBossModulesCommandBuilder.addServerArgument(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
public T setMulticastAddressHint(String address)
Sets the system propertyjboss.default.multicast.addressto the address given. This will override any previous value set viaJBossModulesCommandBuilder.addServerArgument(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
-
addPropertiesFile
public T addPropertiesFile(String file)
Adds a properties file to be passed to the server. Note that the file must exist.- Parameters:
file- the file to add- Returns:
- the builder
- Throws:
IllegalArgumentException- if the file does not exist or is not a regular file
-
addPropertiesFile
public T addPropertiesFile(Path file)
Adds a properties file to be passed to the server. Note that the file must exist.- Parameters:
file- the file to add- Returns:
- the builder
- Throws:
IllegalArgumentException- if the file does not exist or is not a regular file
-
setPropertiesFile
public T setPropertiesFile(String file)
Sets the properties file to use for the server ornullto remove the file. Note that the file must exist.This will override any previous values set.
- Parameters:
file- the properties file to use ornull- Returns:
- the builder
- Throws:
IllegalArgumentException- if the file does not exist or is not a regular file
-
setPropertiesFile
public T setPropertiesFile(Path file)
Sets the properties file to use for the server ornullto remove the file. Note that the file must exist.This will override any previous values set.
- Parameters:
file- the properties file to use ornull- Returns:
- the builder
- Throws:
IllegalArgumentException- if the file does not exist or is not a regular file
-
getLoggingPropertiesArgument
protected String getLoggingPropertiesArgument(String fileName)
Returns the command line argument that specifies the logging configuration.- Parameters:
fileName- the name of the configuration file- Returns:
- the command line argument
-
getBootLogArgument
protected String getBootLogArgument(String fileName)
Returns the command line argument that specifies the path the log file that should be used. This is generally only used on the initial boot of the server in standalone. The server will rewrite the configuration file with hard-coded values.- Parameters:
fileName- the name of the file- Returns:
- the command line argument
-
normalizePath
protected Path normalizePath(String path)
Resolves the path to the path relative to the WildFly home directory.- Parameters:
path- the name of the relative path- Returns:
- the normalized path
-
normalizePath
protected Path normalizePath(Path parent, String path)
Resolves the path relative to the parent and normalizes it.- Parameters:
parent- the parent pathpath- the path- Returns:
- the normalized path
-
-