$darkmode
DENOPTIM
|
Entry point of any kind of run of the DENOPTIM program. More...
Classes | |
enum | RunType |
Types of runs that can be requested to the DENOPTIM Main class. More... | |
Static Public Member Functions | |
static void | main (String[] args) |
Launches the appropriate program according to the arguments given. More... | |
Static Protected Member Functions | |
static Behavior | defineProgramBehavior (String[] args) |
Does the processing of the application arguments and decides what the program should do. More... | |
Static Private Member Functions | |
static void | runProgramTask (Class<?> taskClass, File inputFile, File workDir) |
Creates a task for the given class. More... | |
static Behavior | ensureFileExistsAndIsReadable (File file, Behavior behavior) |
Checks the file exists and format is recognized. More... | |
static String | getHelpString () |
Prints the help message on a string. More... | |
static void | reportError (String msg, int exitCode) |
Prints an error message on standard output and then stops the Virtual Machine with an exit code. More... | |
static void | reportError (Behavior behavior) |
Prints an error message on standard output, possibly after the help message, and then stops the Virtual Machine with an exit code. More... | |
static void | terminate () |
Stops services and halts the Virtual Machine. More... | |
|
staticprotected |
Does the processing of the application arguments and decides what the program should do.
Note that this method already checks if the pathname given for the CLIOptions#input
option is valid.
args | the arguments to process |
Definition at line 439 of file Main.java.
References denoptim.main.Main.RunType.DRY, denoptim.main.Main.ensureFileExistsAndIsReadable(), denoptim.main.Main.getHelpString(), denoptim.main.CLIOptions.getInstance(), denoptim.main.Main.RunType.GUI, denoptim.main.CLIOptions.help, denoptim.main.Main.RunType.isCLIEnabled, denoptim.main.Main.reportError(), denoptim.main.CLIOptions.run, denoptim.logging.Version.VERSION, and denoptim.main.CLIOptions.version.
Referenced by denoptim.main.Main.main(), and denoptim.main.MainTest.testDefineProgramBehavior().
|
staticprivate |
Checks the file exists and format is recognized.
file | file to check. |
behavior | this is where we write error messages. |
Definition at line 406 of file Main.java.
References denoptim.main.Behavior.cmd, denoptim.files.FileUtils.detectFileFormat(), denoptim.main.Behavior.runType, and denoptim.files.FileFormat.UNRECOGNIZED.
Referenced by denoptim.main.Main.defineProgramBehavior().
|
staticprivate |
Prints the help message on a string.
Definition at line 513 of file Main.java.
References denoptim.constants.DENOPTIMConstants.EOL, and denoptim.main.CLIOptions.getInstance().
Referenced by denoptim.main.Main.defineProgramBehavior().
|
static |
Launches the appropriate program according to the arguments given.
Use "-h" to print usage instructions.
args | the list of arguments. |
Definition at line 276 of file Main.java.
References denoptim.main.Behavior.cmd, denoptim.main.Main.defineProgramBehavior(), denoptim.main.Main.RunType.DRY, denoptim.main.Behavior.exitStatus, denoptim.task.StaticTaskManager.getInstance(), denoptim.main.Main.RunType.getProgramTaskImpl(), denoptim.main.Main.RunType.GUI, denoptim.main.Behavior.helpMsg, denoptim.integration.python.Py4JGetawayServer.launch(), denoptim.main.Main.RunType.needsInputFile, denoptim.main.Main.RunType.PY4J, denoptim.main.Main.reportError(), denoptim.main.Main.runProgramTask(), denoptim.main.Behavior.runType, and denoptim.main.Main.terminate().
|
staticprivate |
Prints an error message on standard output, possibly after the help message, and then stops the Virtual Machine with an exit code.
Definition at line 552 of file Main.java.
References denoptim.main.Behavior.errorMsg, denoptim.main.Behavior.exitStatus, denoptim.main.Behavior.helpMsg, and denoptim.main.Main.reportError().
|
staticprivate |
Prints an error message on standard output and then stops the Virtual Machine with an exit code.
msg | the message explaining the type of error. This string will be printed after "ERROR! ". |
exitCode | the exit code for the virtual machine. |
Definition at line 538 of file Main.java.
References denoptim.constants.DENOPTIMConstants.EOL.
Referenced by denoptim.main.Main.defineProgramBehavior(), denoptim.main.Main.main(), denoptim.main.Main.reportError(), and denoptim.main.Main.runProgramTask().
|
staticprivate |
Creates a task for the given class.
taskClass | |
inputFile | |
workDir |
SecurityException | |
NoSuchMethodException |
Definition at line 362 of file Main.java.
References denoptim.constants.DENOPTIMConstants.EOL, denoptim.exception.ExceptionUtils.getStackTraceAsString(), denoptim.main.Main.reportError(), and denoptim.task.StaticTaskManager.submitAndWait().
Referenced by denoptim.main.Main.main().
|
staticprivate |
Stops services and halts the Virtual Machine.
Definition at line 564 of file Main.java.
References denoptim.task.StaticTaskManager.stopAll().
Referenced by denoptim.main.Main.main().