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 ExecutionContext
executionContext
The execution context of the command.protected PrintStream
out
ThePrintStream
that 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 void
applySystemProperties()
Sets the system properties specified by the user command line.File
getCwd()
PrintStream
out()
void
setCwd(File cwd)
Sets the current working directory.void
setSystemProps(List<String> props)
Gets system properties passed in the user command line.void
setUp(ExecutionContext ec)
Set up the command execution environment.void
tearDown()
The command has been executed.
-
-
-
Field Detail
-
executionContext
protected ExecutionContext executionContext
The execution context of the command.
-
out
protected PrintStream out
ThePrintStream
that 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:Command
Set 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:
setUp
in 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 CLIException
Description copied from interface:Command
The command has been executed. Use this method to cleanup the environment.- Specified by:
tearDown
in interfaceCommand
- Throws:
CLIException
- if anything went wrong
-
applySystemProperties
protected void applySystemProperties()
Sets the system properties specified by the user command line.
-
-