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.
Author:
James R. Perkins
  • Method Details

    • create

      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

      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

      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

      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
    • managementAddress

      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
    • managementPort

      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
    • shutdownOnClose

      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
    • redirectErrorStream

      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

      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

      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

      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:
    • redirectError

      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

      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:
    • directory

      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

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

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

      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

      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: