Class LauncherConfig

Object
LauncherConfig

public abstract class LauncherConfig extends Object
Specifies a configuration of the launcher for a particular application.

As the launcher class is used for starting both the command-line tool and the Anchor GUI, this provides the necessary application-specific configuration for each.

Author:
Owen Feehan
  • Constructor Details

    • LauncherConfig

      public LauncherConfig()
  • Method Details

    • resources

      public abstract Resources resources()
      Returns:
      the Resources configuration used by the launcher
    • help

      public abstract HelpConfig help()
      Returns:
      the HelpConfig for displaying help messages
    • newlinesBeforeError

      public abstract boolean newlinesBeforeError()
      Determines if extra newlines should be inserted before error messages.

      This is useful for the GUI client in Windows due to WinRun4j running as a Windows app, and not as a shell app. This changes how output is displayed.

      Returns:
      true if newlines should be inserted before error messages, false otherwise
    • createArguments

      public abstract ExecutionArguments createArguments(org.apache.commons.cli.CommandLine line) throws ExperimentExecutionException
      Creates execution arguments from the command line.
      Parameters:
      line - the CommandLine containing parsed command-line arguments
      Returns:
      the ExecutionArguments created from the command line
      Throws:
      ExperimentExecutionException - if there's an error creating the arguments
    • addAdditionalOptions

      public abstract void addAdditionalOptions(org.apache.commons.cli.Options options)
      Adds additional options to the command-line parser.
      Parameters:
      options - the Options object to which additional options should be added
    • createExperimentExecutor

      public ExperimentExecutor createExperimentExecutor(org.apache.commons.cli.CommandLine line) throws ExperimentExecutionException
      Creates an experiment executor from the command line.
      Parameters:
      line - the CommandLine containing parsed command-line arguments
      Returns:
      the created ExperimentExecutor
      Throws:
      ExperimentExecutionException - if there's an error creating the executor
    • customizeExperimentExecutor

      public abstract void customizeExperimentExecutor(ExperimentExecutor executor, org.apache.commons.cli.CommandLine line) throws ExperimentExecutionException
      Customizes the experiment executor with additional configuration.
      Parameters:
      executor - the ExperimentExecutor to be customized
      line - the CommandLine containing parsed command-line arguments
      Throws:
      ExperimentExecutionException - if there's an error during customization
    • pathRelativeProperties

      protected abstract String pathRelativeProperties()
      Provides the path to a property file that defines a relative-path to the default experiment in bean XML.
      Returns:
      the path to the properties file as a String
    • classInCurrentJar

      protected abstract Class<?> classInCurrentJar()
      Provides a class which is used to determine the base location for pathRelativeProperties().
      Returns:
      the Class in the current JAR