Class StartProcess

All Implemented Interfaces:
Future<Void>, Associator, Eligible

public class StartProcess extends Event<Void>
Starts a new process managed by the ProcessManager component that handles the event.
  • Constructor Details

    • StartProcess

      public StartProcess(String... command)
      Signals that a new process should be started.
      Parameters:
      command - the command
    • StartProcess

      public StartProcess(List<String> command)
      Signals that a new process should be started.
      Parameters:
      command - the command
  • Method Details

    • command

      public String[] command()
      Returns the command.
      Returns:
      the command
    • directory

      public StartProcess directory(File directory)
      Sets the working directory for the process.
      Parameters:
      directory - the directory
      Returns:
      the event for method chaining
    • directory

      public File directory()
      Returns the directory.
      Returns:
      the directory
    • environment

      public StartProcess environment(Map<String,String> environment)
      Sets the environment for the process to be created.

      The values given will be merged with the defaults used by the ProcessBuilder. Overrides any values from a previous invocation or from invoking environment(String, String).

      Parameters:
      environment - the environment
      Returns:
      the event for method chaining
    • environment

      Returns the environment.
      Returns:
      the environment
    • environment

      public StartProcess environment(String key, String value)
      Sets a single value in the environment of the process to be created, see environment(Map).
      Parameters:
      key - the key
      value - the value
      Returns:
      the event for method chaining