Package io.vertx.core.spi.launcher
Interface Command
-
- All Known Implementing Classes:
DefaultCommand
public interface CommandA plug-in to the Vert.x command orLauncherclass. Each command instance is created by aCommandFactory.Commandimplementation can retrieve argument and option using theArgumentandOptionannotations. Documentation / help is provided using theSummary(single sentence) andDescriptionannotations.Commands follow a strict lifecycle. The
setUp(ExecutionContext)method is called with an execution context. It lets you validate the inputs and prepare the environment is needed. Therun()method is called immediately aftersetUp(ExecutionContext), and executes the command. Finally, once the command has completed, thetearDown()method is called. In this method you have the opportunity to cleanup.- Author:
- Clement Escoffier
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidrun()Executes the command.voidsetUp(ExecutionContext context)Set up the command execution environment.voidtearDown()The command has been executed.
-
-
-
Method Detail
-
setUp
void setUp(ExecutionContext context) throws CLIException
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.- Parameters:
context- the context- Throws:
CLIException- if the validation failed
-
run
void run() throws CLIException
Executes the command.- Throws:
CLIException- If anything went wrong.
-
tearDown
void tearDown() throws CLIExceptionThe command has been executed. Use this method to cleanup the environment.- Throws:
CLIException- if anything went wrong
-
-