Class HelpCommand

java.lang.Object
org.apache.juneau.microservice.console.ConsoleCommand
org.apache.juneau.microservice.console.HelpCommand

public class HelpCommand extends ConsoleCommand
Implements the 'restart' console command to gracefully shut down and restart the microservice.
See Also:
  • Constructor Details

  • Method Details

    • getName

      public String getName()
      Description copied from class: ConsoleCommand
      Returns the name of the command.

      Example: "help" for the help command.

      Specified by:
      getName in class ConsoleCommand
      Returns:
      The name of the command.
      Must not be null or contain spaces.
    • getSynopsis

      public String getSynopsis()
      Description copied from class: ConsoleCommand
      Returns the usage synopsis of the command.

      Example: "help [command ...]"

      The default implementation just returns the name, which implies the command takes no additional arguments.

      Overrides:
      getSynopsis in class ConsoleCommand
      Returns:
      The synopsis of the command.
    • getInfo

      public String getInfo()
      Description copied from class: ConsoleCommand
      Returns a one-line localized description of the command.

      The locale should be the system locale.

      Overrides:
      getInfo in class ConsoleCommand
      Returns:
      The localized description of the command.
      Can be null if there is no information.
    • getDescription

      Description copied from class: ConsoleCommand
      Returns localized details of the command.

      The locale should be the system locale.

      Overrides:
      getDescription in class ConsoleCommand
      Returns:
      The localized details of the command.
      Can be null if there is no additional description.
    • getExamples

      public String getExamples()
      Description copied from class: ConsoleCommand
      Returns localized examples of the command.

      The locale should be the system locale.

      Overrides:
      getExamples in class ConsoleCommand
      Returns:
      The localized examples of the command.
      Can be null if there is no examples.
    • execute

      public boolean execute(Scanner in, PrintWriter out, Args args) throws Exception
      Description copied from class: ConsoleCommand
      Executes a command.
      Specified by:
      execute in class ConsoleCommand
      Parameters:
      in - The console reader.
      out - The console writer.
      args - The command arguments. The first argument is always the command itself.
      Returns:
      true if the console read thread should exit.
      Normally you want to return true if your action is causing the microservice to exit or restart.
      Throws:
      Exception - Any thrown exception will simply be sent to STDERR.