Class StarlarkLauncherExtension

java.lang.Object
org.microproxy.starlark.StarlarkLauncherExtension
All Implemented Interfaces:
LauncherExtension

public final class StarlarkLauncherExtension extends Object implements LauncherExtension
Adds --script to the command line when this module is on the class path.
  • Constructor Details

    • StarlarkLauncherExtension

      public StarlarkLauncherExtension()
      Creates an extension with script reloading enabled and no script selected.
  • Method Details

    • usage

      public String usage()
      Description copied from interface: LauncherExtension
      Returns help lines for the options this extension adds, formatted like the built-in ones.
      Specified by:
      usage in interface LauncherExtension
      Returns:
      help lines for the options this extension adds, formatted like the built-in ones
    • parseOption

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

      public void configure(HttpProxyServerBootstrap bootstrap, PrintStream console) throws IOException
      Description copied from interface: LauncherExtension
      Applies the parsed options, after the built-in ones; HttpProxyServerBootstrap.getChainProxyManager() shows any upstream configuration to wrap.
      Specified by:
      configure in interface LauncherExtension
      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