Class LauncherConfig
Object
LauncherConfig
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidaddAdditionalOptions(org.apache.commons.cli.Options options) Adds additional options to the command-line parser.protected abstract Class<?> Provides a class which is used to determine the base location forpathRelativeProperties().abstract ExecutionArgumentscreateArguments(org.apache.commons.cli.CommandLine line) Creates execution arguments from the command line.createExperimentExecutor(org.apache.commons.cli.CommandLine line) Creates an experiment executor from the command line.abstract voidcustomizeExperimentExecutor(ExperimentExecutor executor, org.apache.commons.cli.CommandLine line) Customizes the experiment executor with additional configuration.abstract HelpConfighelp()abstract booleanDetermines if extra newlines should be inserted before error messages.protected abstract StringProvides the path to a property file that defines a relative-path to the default experiment in bean XML.abstract Resources
-
Constructor Details
-
LauncherConfig
public LauncherConfig()
-
-
Method Details
-
resources
- Returns:
- the
Resourcesconfiguration used by the launcher
-
help
- Returns:
- the
HelpConfigfor 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- theCommandLinecontaining parsed command-line arguments- Returns:
- the
ExecutionArgumentscreated 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- theOptionsobject 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- theCommandLinecontaining 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- theExperimentExecutorto be customizedline- theCommandLinecontaining parsed command-line arguments- Throws:
ExperimentExecutionException- if there's an error during customization
-
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
Provides a class which is used to determine the base location forpathRelativeProperties().- Returns:
- the
Classin the current JAR
-