vertx / io.vertx.core / Launcher

# Launcher

`open class Launcher : VertxCommandLauncher, VertxLifecycleHooks`

A `main()` class that can be used to create Vert.x instance and deploy a verticle, or run a bare Vert.x instance. This class is used by the `vertx` command line utility to deploy verticles from the command line. It is extensible as "commands" can be added using the io.vertx.core.spi.launcher.CommandFactory SPI. E.g. `vertx run myverticle.js` `vertx my-command ...` It can also be used as the main class of an executable jar so you can run verticles directly with: `java -jar myapp.jar`

Author
Clement Escoffier

### Constructors

<init> | `Launcher()` A `main()` class that can be used to create Vert.x instance and deploy a verticle, or run a bare Vert.x instance. This class is used by the `vertx` command line utility to deploy verticles from the command line. It is extensible as "commands" can be added using the io.vertx.core.spi.launcher.CommandFactory SPI. E.g. `vertx run myverticle.js` `vertx my-command ...` It can also be used as the main class of an executable jar so you can run verticles directly with: `java -jar myapp.jar`

### Functions

afterConfigParsed | `open fun afterConfigParsed(config: JsonObject): Unit` Hook for sub-classes of Launcher after the config has been parsed.
afterStartingVertx | `open fun afterStartingVertx(vertx: Vertx): Unit` Hook for sub-classes of Launcher after the vertx instance is started.
afterStoppingVertx | `open fun afterStoppingVertx(): Unit`
beforeDeployingVerticle | `open fun beforeDeployingVerticle(deploymentOptions: DeploymentOptions): Unit` Hook for sub-classes of Launcher before the verticle is deployed.
beforeStartingVertx | `open fun beforeStartingVertx(options: VertxOptions): Unit` Hook for sub-classes of Launcher before the vertx instance is started.
beforeStoppingVertx | `open fun beforeStoppingVertx(vertx: Vertx): Unit`
executeCommand | `open static fun executeCommand(cmd: String, vararg args: String): Unit` Utility method to execute a specific command.
handleDeployFailed | `open fun handleDeployFailed(vertx: Vertx, mainVerticle: String, deploymentOptions: DeploymentOptions, cause: Throwable): Unit` A deployment failure has been encountered. You can override this method to customize the behavior. By default it closes the `vertx` instance.
main | `open static fun main(args: Array<String>): Unit` Main entry point.