Interface CommandExecutor

All Known Implementing Classes:
DefaultCommandExecutor, LauncherCommandExecutor

public interface CommandExecutor
Interface that can be implemented to handle commandline arguments. Used by #LaunchContext.
  • Method Details

    • execute

      CommandExecutor execute(io.vertx.core.Promise<CommandResult> future, String... commandLine)
      Executes the given command. Sets handled to false if the command does not exist.
      Parameters:
      future - callback: true if startup should be aborted.
      commandLine - the commands/properties to execute.
      Returns:
      fluent
    • execute

      CommandResult execute(String... command)
      Executes the given command synchronously.
      Parameters:
      command - the command to execute
      Returns:
      true if startup is to be aborted.
    • getCommand

      Optional<String> getCommand()
      Get the first command passed to the executor.
      Returns:
      the initial command as a string.
    • addProperty

      CommandExecutor addProperty(String key, String value)
      Adds a new property to the CommandExecutor that is passed to executed commands.
      Parameters:
      key - the key to identify the property by
      value - a value to bind to the property key
      Returns:
      fluent
    • hasProperty

      boolean hasProperty(String name)
      Check if a property has been set from the commandline.
      Parameters:
      name - the name of the property
      Returns:
      true if the property exists
    • getProperty

      Optional<String> getProperty(String name)
      Get a commandline property passed to the Executor.
      Parameters:
      name - the name of the property to get
      Returns:
      the property as a string value
    • getAllProperties

      List<String> getAllProperties(String name)
      Get a commandline property passed to the Executor.
      Parameters:
      name - the name of the property to get
      Returns:
      a list of all the property values.
    • add

      CommandExecutor add(Command command)
      Registers a new command to the CommandExecutor.
      Parameters:
      command - the command to add
      Returns:
      fluent
    • add

      CommandExecutor add(BiFunction<io.vertx.core.Promise<CommandResult>,​CommandExecutor,​Void> executor, String name, String description)
      Adds a new asynchronous command using the default implementation.
      Parameters:
      executor - the method to execute when the command is executed.
      name - the name of the command to add
      description - the description of the command
      Returns:
      fluent
    • add

      CommandExecutor add(Function<CommandExecutor,​CommandResult> executor, String name, String description)
      Adds a new synchronous command using the default implementation.
      Parameters:
      executor - the method to execute when the command is executed
      name - the name of the command to add
      description - the description of the command
      Returns:
      fluent
    • list

      Lists all commands added to the executor.
      Returns:
      a list of commands registered.
    • clear

      Removes all registered commands.
      Returns:
      fluent.