Package io.vertx.launcher.application

## Interface VertxApplicationHooks

-     public interface VertxApplicationHooks

  Methods invoked by the `VertxApplication` at different stages of the launch process.

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static VertxApplicationHooks` | `DEFAULT` |

  - ### Method Summary

    All Methods Instance Methods Default Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `default void` | `afterFailureToDeployVerticle​(HookContext context, Throwable t)` | Invoked after the verticle has failed to be deployed.
    `default void` | `afterFailureToStartVertx​(HookContext context, Throwable t)` | Invoked after Vert.x has failed to start.
    `default void` | `afterFailureToStopVertx​(HookContext context, Throwable t)` | Invoked after Vert.x has failed to stop.
    `default void` | `afterVerticleDeployed​(HookContext context)` | Invoked after the verticle has been deployed successfully.
    `default void` | `afterVertxStarted​(HookContext context)` | Invoked after Vert.x has started successfully.
    `default void` | `afterVertxStopped​(HookContext context)` | Invoked after Vert.x has stopped successfully.
    `default void` | `beforeDeployingVerticle​(HookContext context)` | Invoked before deploying the main verticle.
    `default void` | `beforeStartingVertx​(HookContext context)` | Invoked before starting Vert.x.
    `default void` | `beforeStoppingVertx​(HookContext context)` | Invoked before stopping Vert.x.
    `default VertxBuilder` | `createVertxBuilder​(VertxOptions options)` | Default implementation for the `VertxBuilder` creation.
    `default java.util.function.Supplier<Verticle>` | `verticleSupplier()` | Invoked before deploying the main verticle.

- - ### Field Detail

    - #### DEFAULT

          static final VertxApplicationHooks DEFAULT

  - ### Method Detail

    - #### beforeStartingVertx

          default void beforeStartingVertx​(HookContext context)

      Invoked before starting Vert.x.

      At this stage the `HookContext.vertxOptions()` can still be modified.

      Parameters:
        `context` - exposes objects available at this stage of the `VertxApplication` launch process

    - #### createVertxBuilder

          default VertxBuilder createVertxBuilder​(VertxOptions options)

      Default implementation for the `VertxBuilder` creation.

      This can be overridden in order to customize, for example, the tracer, with `VertxBuilder.withTracer(VertxTracerFactory)`.

      Parameters:
        `options` - the Vert.x options to use
      Returns:
        the Vert.x builder instance

    - #### afterVertxStarted

          default void afterVertxStarted​(HookContext context)

      Invoked after Vert.x has started successfully.
      Parameters:
        `context` - exposes objects available at this stage of the `VertxApplication` launch process

    - #### afterFailureToStartVertx

          default void afterFailureToStartVertx​(HookContext context,
                                                Throwable t)

      Invoked after Vert.x has failed to start.
      Parameters:
        `context` - exposes objects available at this stage of the `VertxApplication` launch process
        `t` - the failure or `null` if Vert.x took too long to start

    - #### verticleSupplier

          default java.util.function.Supplier<Verticle> verticleSupplier()

      Invoked before deploying the main verticle.

      If the implementation returns a non-`null` supplier, it will be used to create the instance(s) of the verticle, regardless of the value provided on the command line or in the JAR's `META-INF/MANIFEST.MF` file.

    - #### beforeDeployingVerticle

          default void beforeDeployingVerticle​(HookContext context)

      Invoked before deploying the main verticle.

      At this stage the `HookContext.deploymentOptions()` can still be modified.

      Parameters:
        `context` - exposes objects available at this stage of the `VertxApplication` launch process

    - #### afterVerticleDeployed

          default void afterVerticleDeployed​(HookContext context)

      Invoked after the verticle has been deployed successfully.
      Parameters:
        `context` - exposes objects available at this stage of the `VertxApplication` launch process

    - #### afterFailureToDeployVerticle

          default void afterFailureToDeployVerticle​(HookContext context,
                                                    Throwable t)

      Invoked after the verticle has failed to be deployed.

      By default, the Vert.x instance is closed.

      Parameters:
        `context` - exposes objects available at this stage of the `VertxApplication` launch process
        `t` - the failure or `null` if the verticle took too long to start

    - #### beforeStoppingVertx

          default void beforeStoppingVertx​(HookContext context)

      Invoked before stopping Vert.x.
      Parameters:
        `context` - exposes objects available at this stage of the `VertxApplication` launch process

    - #### afterVertxStopped

          default void afterVertxStopped​(HookContext context)

      Invoked after Vert.x has stopped successfully.
      Parameters:
        `context` - exposes objects available at this stage of the `VertxApplication` launch process

    - #### afterFailureToStopVertx

          default void afterFailureToStopVertx​(HookContext context,
                                               Throwable t)

      Invoked after Vert.x has failed to stop.
      Parameters:
        `context` - exposes objects available at this stage of the `VertxApplication` launch process
        `t` - the failure or `null` if Vert.x took too long to stop