Interface LauncherExtension

All Known Implementing Classes:
OtelLauncherExtension, StarlarkLauncherExtension

public interface LauncherExtension
Adds command-line options to Launcher. Implementations are found with ServiceLoader, so an optional module on the class path (such as microproxy-starlark) can contribute options without the core depending on it.
  • Method Details

    • usage

      String usage()
      Returns help lines for the options this extension adds, formatted like the built-in ones.
      Returns:
      help lines for the options this extension adds, formatted like the built-in ones
    • parseOption

      boolean parseOption(String option, Deque<String> args)
      Consumes option if it belongs to this extension, taking any values from the front of args. Returns false for options it does not recognise.
      Parameters:
      option - the command-line option to parse
      args - the remaining command-line arguments
      Returns:
      whether this extension consumed the option
    • configure

      void configure(HttpProxyServerBootstrap bootstrap, PrintStream console) throws IOException
      Applies the parsed options, after the built-in ones; HttpProxyServerBootstrap.getChainProxyManager() shows any upstream configuration to wrap.
      Parameters:
      bootstrap - the proxy configuration to extend
      console - the output stream for status messages and diagnostics
      Throws:
      IOException - if extension configuration cannot be loaded or initialized