Top Description Methods
io.vertx.core.spi.launcher

public Interface Command

Known Direct Implementers
io.vertx.core.spi.launcher.DefaultCommand
Imports
io.vertx.core.cli.CLIException, io.vertx.core.cli.annotations.Argument, .Description, .Option, .Summary

A plug-in to the Vert.x command or io.vertx.core.Launcher class. Each command instance is created by a CommandFactory.

Command implementation can retrieve argument and option using the Argument and Option annotations. Documentation / help is provided using the Summary (single sentence) and Description annotations.

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. The run() method is called immediately after setUp(ExecutionContext), and executes the command. Finally, once the command has completed, the tearDown() method is called. In this method you have the opportunity to cleanup.

Author
Clement Escoffier

Method Summary

Modifier and TypeMethod and Description
public void
run()

Executes the command.

public void
setUp(ExecutionContext
the context
context
)

Set up the command execution environment.

public void
tearDown()

The command has been executed.

Method Detail

runback to summary
public void run() throws CLIException

Executes the command.

Exceptions
CLIException:
If anything went wrong.
setUpback to summary
public 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:ExecutionContext

the context

Exceptions
CLIException:
if the validation failed
tearDownback to summary
public void tearDown() throws CLIException

The command has been executed. Use this method to cleanup the environment.

Exceptions
CLIException:
if anything went wrong