Package io.vertx.core.spi.launcher
Class DefaultCommand
- java.lang.Object
-
- io.vertx.core.spi.launcher.DefaultCommand
-
-
Field Summary
Fields Modifier and Type Field Description protected ExecutionContextexecutionContextThe execution context of the command.protected PrintStreamoutThePrintStreamthat the command can use to write on the console.protected List<String>systemProperties
-
Constructor Summary
Constructors Constructor Description DefaultCommand()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidapplySystemProperties()Sets the system properties specified by the user command line.FilegetCwd()PrintStreamout()voidsetCwd(File cwd)Sets the current working directory.voidsetSystemProps(List<String> props)Gets system properties passed in the user command line.voidsetUp(ExecutionContext ec)Set up the command execution environment.voidtearDown()The command has been executed.
-
-
-
Field Detail
-
executionContext
protected ExecutionContext executionContext
The execution context of the command.
-
out
protected PrintStream out
ThePrintStreamthat the command can use to write on the console.
-
-
Method Detail
-
getCwd
public File getCwd()
- Returns:
- the configure current working directory. If not set use the "regular" Java current working directory.
-
setCwd
public void setCwd(File cwd)
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
public void setSystemProps(List<String> props)
Gets system properties passed in the user command line. The user can configure system properties using-Dkey=value.- Parameters:
props- the properties
-
setUp
public void setUp(ExecutionContext ec) throws CLIException
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
public PrintStream out()
- Returns:
- the print stream on which message should be written.
-
tearDown
public void tearDown() throws CLIExceptionDescription 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.
-
-