PT - Type of CLI parameters class@Beta public interface CliInvocationSpec<PT>
| Modifier and Type | Method and Description |
|---|---|
<ET extends Exception> |
handle(Class<ET> exceptionClass,
Consumer<ET> handler)
Register exception handler.
|
void |
launch(CliEntry<PT> launcher)
Launch main method.
|
<ST> CliInvocationSpec2<PT,ST> |
statProf(Class<ST> statClass)
Specify execution statistics type.
|
CliInvocationSpec<PT> |
usage(Supplier<String> usageHelp)
Specify usage.
|
<ET extends Exception> CliInvocationSpec<PT> handle(Class<ET> exceptionClass, Consumer<ET> handler)
ET - Exception typeexceptionClass - Exception type to handlehandler - Handlervoid launch(CliEntry<PT> launcher)
launcher - Entry point to launch with the parsed CLI parametersCliInvocationSpec<PT> usage(Supplier<String> usageHelp)
help. When it is true prints help and returns a
nullary instance (which methods does nothing) effectively terminating execution.
Required field of the CLI parameters object are:
boolean help - Print command line help and exit. The annotated
Parameter.help() must be true.)usageHelp - Supplier of usage help. Implementation is excpected to be free of side effects.<ST> CliInvocationSpec2<PT,ST> statProf(Class<ST> statClass)
String [] cliArguments - Command line arguments<PT> cliParameters - Parsed parameters objectMap<String, String> env - Environment variablesMap<String, String> props - System propertieslong startTime - Launch timelong stopTime - Finishing timelong elapsedTime - Elapsed time in msMemstat memstatInitial - Memstat taken on/around startupMemstat memstatFinal - Memstat taken after finishingProfSnapshot profSnapshotInitial - Profiler snapshot taken on/around startupProfSnapshot profSnapshotFinal - Profiler snapshot taken on/around finishingString stat - Optional file name to write execution statisticsString prof - Optional file name to write profiling and statisticsint profres - Resolution of the profiling info. Update time between snapshot writes in msboolean statGcInitial - Invoke GC on initial memory/profiling snapshotsboolean statGcFinal - Invoke GC on final memory/profiling snapshotsST - Type of execution statisticsstatClass - Type of execution statistics