- 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 home
directory 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 DomainCommandBuilder
addHostControllerJavaOption(String arg)
Adds a JVM argument to the host controller ignoringnull
values.DomainCommandBuilder
addHostControllerJavaOptions(Iterable<String> args)
Adds a JVM arguments to the host controller ignoringnull
values.DomainCommandBuilder
addHostControllerJavaOptions(String... args)
Adds a JVM arguments to the host controller ignoringnull
values.T
addModuleDir(String moduleDir)
Adds a directory to the collection of module paths.T
addModuleDirs(Iterable<String> moduleDirs)
Adds all the module directories to the collection of module paths.T
addModuleDirs(String... moduleDirs)
Adds all the module directories to the collection of module paths.DomainCommandBuilder
addProcessControllerJavaOption(String arg)
Adds a JVM argument to the process controller ignoringnull
values.DomainCommandBuilder
addProcessControllerJavaOptions(Iterable<String> args)
Adds a JVM arguments to the process controller ignoringnull
values.DomainCommandBuilder
addProcessControllerJavaOptions(String... args)
Adds a JVM arguments to the process controller ignoringnull
values.T
addPropertiesFile(String file)
Adds a properties file to be passed to the server.T
addPropertiesFile(Path file)
Adds a properties file to be passed to the server.T
addServerArgument(String arg)
Adds an argument to be passed to the server ignore the argument ifnull
.T
addServerArguments(Iterable<String> args)
Adds the arguments to the collection of arguments that will be passed to the server ignoring anynull
arguments.T
addServerArguments(String... args)
Adds the arguments to the collection of arguments that will be passed to the server ignoring anynull
arguments.protected static void
addSystemPropertyArg(List<String> cmd, String key, Object value)
List<String>
buildArguments()
A list of command arguments required to launch WildFly instance.Path
getBaseDirectory()
Returns the base directory for the server.protected String
getBootLogArgument(String fileName)
Returns the command line argument that specifies the path the log file that should be used.Path
getConfigurationDirectory()
Returns the configuration directory for the server.String
getDomainConfiguration()
Returns the configuration fileset
ornull
if one was not set.String
getHostConfiguration()
Returns the configuration fileset
ornull
if one was not set.Path
getHostControllerJavaHome()
Returns the Java home path the host controller will use.List<String>
getHostControllerJavaOptions()
Returns the JVM arguments for the host controller.Path
getJavaHome()
Returns the Java home directory where the java executable command can be found.Path
getLogDirectory()
Returns the log directory for the server.protected String
getLoggingPropertiesArgument(String fileName)
Returns the command line argument that specifies the logging configuration.List<String>
getProcessControllerJavaOptions()
Returns the JVM arguments used for the process controller.String
getReadOnlyDomainConfiguration()
Returns the configuration filesetReadOnlyDomainConfiguration(String)
set} ornull
if one was not set.String
getReadOnlyHostConfiguration()
Returns the configuration filesetReadOnlyHostConfiguration(String)
set} ornull
if one was not set.Path
getServerJavaHome()
Returns the Java home path the servers will use.protected DomainCommandBuilder
getThis()
Returns the concrete builder.protected Path
normalizePath(String path)
Resolves the path to the path relative to the WildFly home directory.protected Path
normalizePath(Path parent, String path)
Resolves the path relative to the parent and normalizes it.static DomainCommandBuilder
of(String wildflyHome)
Creates a command builder for a domain instance of WildFly.static DomainCommandBuilder
of(String wildflyHome, String javaHome)
Creates a command builder for a domain instance of WildFly.static DomainCommandBuilder
of(Path wildflyHome)
Creates a command builder for a domain instance of WildFly.static DomainCommandBuilder
of(Path wildflyHome, Path javaHome)
Creates a command builder for a domain instance of WildFly.T
setAdminOnly()
Sets the server argument--admin-only
.DomainCommandBuilder
setBackup()
Sets the option (--backup
to keep a copy of the persistent domain configuration even if this host is not a domain controller.DomainCommandBuilder
setBaseDirectory(String baseDir)
Sets the base directory to use.DomainCommandBuilder
setBaseDirectory(Path baseDir)
Sets the base directory to use.T
setBindAddressHint(String address)
Sets the system propertyjboss.bind.address
to the address given.T
setBindAddressHint(String interfaceName, String address)
Sets the system propertyjboss.bind.address.$INTERFACE
to the address given where$INTERFACE
is theinterfaceName
parameter.DomainCommandBuilder
setCachedDomainController()
Sets the option (--cached-dc
) to boot using a locally cached copy of the domain configuration.T
setConfigurationDirectory(String path)
Sets the configuration directory to be used for configuration files.T
setConfigurationDirectory(Path path)
Sets the configuration directory to be used for configuration files.DomainCommandBuilder
setDomainConfiguration(String configFile)
Sets the configuration file for the domain (domain.xml).DomainCommandBuilder
setHostConfiguration(String configFile)
Sets the configuration file for the host controller (host.xml).DomainCommandBuilder
setHostControllerJavaHome(String javaHome)
Sets the Java home for the host controller.DomainCommandBuilder
setHostControllerJavaHome(Path javaHome)
Sets the Java home for the host controller.DomainCommandBuilder
setHostControllerJavaOptions(Iterable<String> args)
Sets the JVM arguments for the host controller ignoringnull
values in the collection.DomainCommandBuilder
setHostControllerJavaOptions(String... args)
Sets the JVM arguments for the host controller ignoringnull
values in the array.DomainCommandBuilder
setInterProcessHostControllerAddress(String address)
Sets the address on which the host controller should listen for communication from the process controller (interprocess-hc-address
).DomainCommandBuilder
setInterProcessHostControllerPort(int port)
Sets the port on which the host controller should listen for communication from the process controller (interprocess-hc-address
).DomainCommandBuilder
setInterProcessHostControllerPort(String port)
Sets the port on which the host controller should listen for communication from the process controller (interprocess-hc-address
).T
setLogDirectory(String path)
Sets the log directory to be used for log files.T
setLogDirectory(Path path)
Sets the log directory to be used for log files.DomainCommandBuilder
setMasterAddressHint(String address)
Sets the system propertyjboss.domain.primary.address
.DomainCommandBuilder
setMasterPortHint(int port)
Sets the system propertyjboss.domain.primary.port
.DomainCommandBuilder
setMasterPortHint(String port)
Sets the system propertyjboss.domain.primary.port
.T
setModuleDirs(Iterable<String> moduleDirs)
Replaces any previously set module directories with the collection of module directories.T
setModuleDirs(String... moduleDirs)
Replaces any previously set module directories with the array of module directories.T
setMulticastAddressHint(String address)
Sets the system propertyjboss.default.multicast.address
to the address given.DomainCommandBuilder
setProcessControllerAddress(String address)
Sets the address on which the process controller listens for communication from processes it controls.DomainCommandBuilder
setProcessControllerJavaOptions(Iterable<String> args)
Sets the JVM arguments for the process controller ignoringnull
values in the collection.DomainCommandBuilder
setProcessControllerJavaOptions(String... args)
Sets the JVM arguments for the process controller ignoringnull
values in the array.DomainCommandBuilder
setProcessControllerPort(int port)
Sets the port on which the process controller listens for communication from processes it controls.DomainCommandBuilder
setProcessControllerPort(String port)
Sets the port on which the process controller listens for communication from processes it controls.T
setPropertiesFile(String file)
Sets the properties file to use for the server ornull
to remove the file.T
setPropertiesFile(Path file)
Sets the properties file to use for the server ornull
to remove the file.DomainCommandBuilder
setReadOnlyDomainConfiguration(String configFile)
Sets the read only configuration file for the domain (domain.xml).DomainCommandBuilder
setReadOnlyHostConfiguration(String configFile)
Sets the read only configuration file for the host controller (host.xml).DomainCommandBuilder
setServerJavaHome(String javaHome)
Sets the Java home for the servers that are launched in the domain.DomainCommandBuilder
setServerJavaHome(Path javaHome)
Sets the Java home for the servers that are launched in the domain.DomainCommandBuilder
setStability(String stability)
Sets the stability level of the standalone server process.T
setStartSuspended()
Sets the server argument--start-mode=suspend
.T
setUseSecurityManager(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.home
to 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.home
to 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 (--backup
to 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
). Ignoresnull
values.- 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
). Ignoresnull
values 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. Ignoresnull
values. 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. Ignoresnull
values 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. Ignoresnull
values.- 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. Ignoresnull
values 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 ornull
to 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 ornull
to resolve the base directory- Returns:
- the builder
-
setHostControllerJavaHome
public DomainCommandBuilder setHostControllerJavaHome(String javaHome)
Sets the Java home for the host controller. If thejavaHome
is notnull
then the java executable will be resolved and used to launch the host processor. If thejavaHome
isnull
the same java executable will be used to launch the host controller that launched the process controller.- Parameters:
javaHome
- the java home to set, can benull
to use the default- Returns:
- the builder
-
setHostControllerJavaHome
public DomainCommandBuilder setHostControllerJavaHome(Path javaHome)
Sets the Java home for the host controller. If thejavaHome
is notnull
then the java executable will be resolved and used to launch the host processor. If thejavaHome
isnull
the same java executable will be used to launch the host controller that launched the process controller.- Parameters:
javaHome
- the java home to set, can benull
to 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 theconfiguration
directory. A value ofnull
is ignored.- Parameters:
configFile
- the configuration file name- Returns:
- the builder
-
getHostConfiguration
public String getHostConfiguration()
Returns the configuration fileset
ornull
if one was not set.- Returns:
- the configuration file set or
null
if 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 theconfiguration
directory. A value ofnull
is 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} ornull
if one was not set.- Returns:
- the configuration file set or
null
if not set
-
setDomainConfiguration
public DomainCommandBuilder setDomainConfiguration(String configFile)
Sets the configuration file for the domain (domain.xml). The file must be in theconfiguration
directory. A value ofnull
is ignored. This will override any previous value set.- Parameters:
configFile
- the configuration file name- Returns:
- the builder
-
getDomainConfiguration
public String getDomainConfiguration()
Returns the configuration fileset
ornull
if one was not set.- Returns:
- the configuration file set or
null
if not set
-
setReadOnlyDomainConfiguration
public DomainCommandBuilder setReadOnlyDomainConfiguration(String configFile)
Sets the read only configuration file for the domain (domain.xml). The file must be in theconfiguration
directory. A value ofnull
is 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} ornull
if one was not set.- Returns:
- the configuration file set or
null
if not set
-
addHostControllerJavaOption
public DomainCommandBuilder addHostControllerJavaOption(String arg)
Adds a JVM argument to the host controller ignoringnull
values.- Parameters:
arg
- the argument to add- Returns:
- the builder
-
addHostControllerJavaOptions
public DomainCommandBuilder addHostControllerJavaOptions(String... args)
Adds a JVM arguments to the host controller ignoringnull
values.- Parameters:
args
- the arguments to add- Returns:
- the builder
-
addHostControllerJavaOptions
public DomainCommandBuilder addHostControllerJavaOptions(Iterable<String> args)
Adds a JVM arguments to the host controller ignoringnull
values.- Parameters:
args
- the arguments to add- Returns:
- the builder
-
setHostControllerJavaOptions
public DomainCommandBuilder setHostControllerJavaOptions(String... args)
Sets the JVM arguments for the host controller ignoringnull
values in the array. If the array isnull
the 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 ignoringnull
values in the collection. If the collection isnull
the 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 ignoringnull
values.- Parameters:
arg
- the argument to add- Returns:
- the builder
-
addProcessControllerJavaOptions
public DomainCommandBuilder addProcessControllerJavaOptions(String... args)
Adds a JVM arguments to the process controller ignoringnull
values.- Parameters:
args
- the arguments to add- Returns:
- the builder
-
addProcessControllerJavaOptions
public DomainCommandBuilder addProcessControllerJavaOptions(Iterable<String> args)
Adds a JVM arguments to the process controller ignoringnull
values.- Parameters:
args
- the arguments to add- Returns:
- the builder
-
setProcessControllerJavaOptions
public DomainCommandBuilder setProcessControllerJavaOptions(String... args)
Sets the JVM arguments for the process controller ignoringnull
values in the array. If the array isnull
the 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 ignoringnull
values in the collection. If the collection isnull
the 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 thejavaHome
is notnull
then the java executable will be resolved and used to launch the servers in the domain. If thejavaHome
isnull
the 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 benull
to 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 thejavaHome
is notnull
then the java executable will be resolved and used to launch the servers in the domain. If thejavaHome
isnull
the 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 benull
to 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:CommandBuilder
A list of command arguments required to launch WildFly instance. These are the arguments the follow ajava
executable command.- Specified by:
buildArguments
in interfaceCommandBuilder
- Overrides:
buildArguments
in 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:JBossModulesCommandBuilder
Sets whether or not the security manager option,-secmgr
, should be used.- Overrides:
setUseSecurityManager
in classJBossModulesCommandBuilder
- Parameters:
useSecMgr
-true
to use the a security manager, otherwisefalse
- Returns:
- the builder
-
addModuleDir
public T addModuleDir(String moduleDir)
Description copied from class:JBossModulesCommandBuilder
Adds a directory to the collection of module paths.- Overrides:
addModuleDir
in classJBossModulesCommandBuilder
- Parameters:
moduleDir
- the module directory to add- Returns:
- the builder
-
addModuleDirs
public T addModuleDirs(String... moduleDirs)
Description copied from class:JBossModulesCommandBuilder
Adds all the module directories to the collection of module paths.- Overrides:
addModuleDirs
in classJBossModulesCommandBuilder
- Parameters:
moduleDirs
- an array of module paths to add- Returns:
- the builder
-
addModuleDirs
public T addModuleDirs(Iterable<String> moduleDirs)
Description copied from class:JBossModulesCommandBuilder
Adds all the module directories to the collection of module paths.- Overrides:
addModuleDirs
in classJBossModulesCommandBuilder
- Parameters:
moduleDirs
- a collection of module paths to add- Returns:
- the builder
-
setModuleDirs
public T setModuleDirs(Iterable<String> moduleDirs)
Description copied from class:JBossModulesCommandBuilder
Replaces 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:
setModuleDirs
in classJBossModulesCommandBuilder
- Parameters:
moduleDirs
- the collection of module directories to use- Returns:
- the builder
-
setModuleDirs
public T setModuleDirs(String... moduleDirs)
Description copied from class:JBossModulesCommandBuilder
Replaces 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:
setModuleDirs
in 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 ornull
to 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 ornull
to 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 ornull
to 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 ornull
to 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:JBossModulesCommandBuilder
Adds an argument to be passed to the server ignore the argument ifnull
.- Overrides:
addServerArgument
in classJBossModulesCommandBuilder
- Parameters:
arg
- the argument to pass- Returns:
- the builder
-
addServerArguments
public T addServerArguments(String... args)
Description copied from class:JBossModulesCommandBuilder
Adds the arguments to the collection of arguments that will be passed to the server ignoring anynull
arguments.- Overrides:
addServerArguments
in classJBossModulesCommandBuilder
- Parameters:
args
- the arguments to add- Returns:
- the builder
-
addServerArguments
public T addServerArguments(Iterable<String> args)
Description copied from class:JBossModulesCommandBuilder
Adds the arguments to the collection of arguments that will be passed to the server ignoring anynull
arguments.- Overrides:
addServerArguments
in 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.address
to 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.$INTERFACE
to the address given where$INTERFACE
is theinterfaceName
parameter. For example in the default configuration passingmanagement
for theinterfaceName
parameter would result in the system propertyjboss.bind.address.management
being 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.address
to 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 ornull
to 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 ornull
to 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
-
-