Class DefaultCommand
java.lang.Object
io.vertx.core.spi.launcher.DefaultCommand
- All Implemented Interfaces:
Command
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ExecutionContextThe execution context of the command.protected PrintStreamThePrintStreamthat the command can use to write on the console. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidSets the system properties specified by the user command line.getCwd()out()voidSets the current working directory.voidsetSystemProps(List<String> props) Gets system properties passed in the user command line.voidSet up the command execution environment.voidtearDown()The command has been executed.
-
Field Details
-
systemProperties
-
executionContext
The execution context of the command. -
out
ThePrintStreamthat the command can use to write on the console.
-
-
Constructor Details
-
DefaultCommand
public DefaultCommand()
-
-
Method Details
-
getCwd
- Returns:
- the configure current working directory. If not set use the "regular" Java current working directory.
-
setCwd
Sets the current working directory. This method is called when the user configure the "cwd" option as follows:--cwd=the-directory.- Parameters:
cwd- the directory
-
setSystemProps
-
setUp
Description copied from interface:CommandSet up the command execution environment. The command line model has been retrieved and is frozen. Values has been set / injected. You can use this callback to validate the inputs.- Specified by:
setUpin interfaceCommand- Parameters:
ec- the context- Throws:
CLIException- if the validation failed
-
out
- Returns:
- the print stream on which message should be written.
-
tearDown
Description copied from interface:CommandThe command has been executed. Use this method to cleanup the environment.- Specified by:
tearDownin interfaceCommand- Throws:
CLIException- if anything went wrong
-
applySystemProperties
protected void applySystemProperties()Sets the system properties specified by the user command line.
-