Class Configuration<T extends Configuration<T>>

java.lang.Object
org.wildfly.plugin.tools.server.Configuration<T>
Direct Known Subclasses:
DomainConfiguration, StandaloneConfiguration

public abstract class Configuration<T extends Configuration<T>> extends Object
The configuration used when starting a server.
Since:
1.2
Author:
James R. Perkins
  • Constructor Details Link icon

    • Configuration Link icon

      protected Configuration(org.wildfly.core.launcher.CommandBuilder commandBuilder)
  • Method Details Link icon

    • create Link icon

      public static StandaloneConfiguration create(org.wildfly.core.launcher.StandaloneCommandBuilder commandBuilder)
      Creates a standalone configuration to launch a standalone server.
      Parameters:
      commandBuilder - the standalone command builder used to launch the server
      Returns:
      a new standalone configuration
    • create Link icon

      public static StandaloneConfiguration create(org.wildfly.core.launcher.BootableJarCommandBuilder commandBuilder)
      Creates a standalone configuration to launch a standalone server via the bootable JAR.
      Parameters:
      commandBuilder - the bootable JAR command builder used to launch the server
      Returns:
      a new standalone configuration
    • create Link icon

      public static DomainConfiguration create(org.wildfly.core.launcher.DomainCommandBuilder commandBuilder)
      Creates a domain configuration to launch a domain server
      Parameters:
      commandBuilder - the domain command builder used to launch the server
      Returns:
      a new domain configuration
    • client Link icon

      public T client(org.jboss.as.controller.client.ModelControllerClient client)
      Sets the client to use for the server manager.

      If the the server manager is closed, the client will also be closed.

      Parameters:
      client - the client to use to communicate with the server
      Returns:
      this configuration
    • client Link icon

      protected org.jboss.as.controller.client.ModelControllerClient client()
      The client set on the configuration or a new client.
      Returns:
      the client to use
    • managementAddress Link icon

      public T managementAddress(String managementAddress)
      The management address to use for the client if the client has not been set.
      Parameters:
      managementAddress - the management address, default is localhost
      Returns:
      this configuration
    • managementAddress Link icon

      protected String managementAddress()
      The management address set or 127.0.0.1 if not set.
      Returns:
      the management address
    • managementPort Link icon

      public T managementPort(int managementPort)
      The management port to use for the client if the client has not been set.
      Parameters:
      managementPort - the management port, default is 9990
      Returns:
      this configuration
    • managementPort Link icon

      protected int managementPort()
      The management port or 9990 if set to 0 or less.
      Returns:
      the management port
    • shutdownOnClose Link icon

      public T shutdownOnClose(boolean shutdownOnClose)
      When set to true the server will be shutdown when the server manager is closed.
      Parameters:
      shutdownOnClose - true to shutdown the server when the server manager is closed
      Returns:
      this configuration
    • shutdownOnClose Link icon

      protected boolean shutdownOnClose()
      Indicates if the server should be shutdown when the ServerManager is closed.
      Returns:
      true to shutdown the server when the is closed
    • redirectErrorStream Link icon

      public T redirectErrorStream(boolean redirectErrorStream)
      Set to true if the error stream should be redirected to the output stream.
      Parameters:
      redirectErrorStream - true to merge the error stream into the output stream, otherwise false to keep the streams separate
      Returns:
      the Configuration
    • redirectOutput Link icon

      public T redirectOutput(File file)
      Redirects the output of the process to a file.
      Parameters:
      file - the file to redirect the output to
      Returns:
      the Configuration
      See Also:
    • redirectOutput Link icon

      public T redirectOutput(Path path)
      Redirects the output of the process to a file.
      Parameters:
      path - the path to redirect the output to
      Returns:
      the Configuration
      See Also:
    • redirectOutput Link icon

      public T redirectOutput(ProcessBuilder.Redirect destination)
      Redirects the output of the process to the destination provided.
      Parameters:
      destination - the output destination
      Returns:
      the Configuration
      See Also:
    • consumeStdout Link icon

      protected boolean consumeStdout()
      Checks if the output stream (stdout) needs to be consumed.
      Returns:
      true if the output stream should be consumed, otherwise false
    • redirectError Link icon

      public T redirectError(File file)
      Redirects the error stream of the process to a file.
      Parameters:
      file - the file to redirect the error stream to
      Returns:
      the Configuration
      See Also:
    • redirectError Link icon

      public T redirectError(ProcessBuilder.Redirect destination)
      Redirects the error stream of the process to the destination provided.
      Parameters:
      destination - the error stream destination
      Returns:
      the Configuration
      See Also:
    • consumeStderr Link icon

      protected boolean consumeStderr()
      Checks if the error stream (stderr) needs to be consumed.
      Returns:
      true if the error stream should be consumed, otherwise false
    • directory Link icon

      public T directory(Path path)
      Sets the working directory for the process created.
      Parameters:
      path - the path to the working directory
      Returns:
      the Configuration
      See Also:
    • directory Link icon

      public T directory(File dir)
      Sets the working directory for the process created.
      Parameters:
      dir - the working directory
      Returns:
      the Configuration
      See Also:
    • directory Link icon

      public T directory(String dir)
      Sets the working directory for the process created.
      Parameters:
      dir - the working directory
      Returns:
      the Configuration
      See Also:
    • addEnvironmentVariable Link icon

      public T addEnvironmentVariable(String key, String value)
      Adds an environment variable to the process being created. If the key or value is null, the environment variable will not be added.
      Parameters:
      key - they key for the variable
      value - the value for the variable
      Returns:
      the Configuration
      See Also:
    • addEnvironmentVariables Link icon

      public T addEnvironmentVariables(Map<String,String> env)
      Adds the environment variables to the process being created. Note that null keys or values will not be added.
      Parameters:
      env - the environment variables to add
      Returns:
      the Configuration
      See Also:
    • commandBuilder Link icon

      protected org.wildfly.core.launcher.CommandBuilder commandBuilder()
      The command builder used to create the launcher.
      Returns:
      the command builder
    • launcher Link icon

      protected org.wildfly.core.launcher.Launcher launcher()
      A configured launcher for create the server process.
      Returns:
      the configured launcher
    • launchType Link icon

      protected abstract Configuration.LaunchType launchType()
      The type of the server to launch.
      Returns:
      the type of the server
    • self Link icon

      protected abstract T self()
      This instance.
      Returns:
      this instance