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 void
addAdditionalOptions
(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 ExecutionArguments
createArguments
(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 void
customizeExperimentExecutor
(ExperimentExecutor executor, org.apache.commons.cli.CommandLine line) Customizes the experiment executor with additional configuration.abstract HelpConfig
help()
abstract boolean
Determines if extra newlines should be inserted before error messages.protected abstract String
Provides 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
Resources
configuration used by the launcher
-
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
- theCommandLine
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
- theOptions
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
- theCommandLine
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
- theExperimentExecutor
to be customizedline
- theCommandLine
containing 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
Class
in the current JAR
-