Interface VertxApplicationHooks


  • public interface VertxApplicationHooks
    Methods invoked by the VertxApplication at different stages of the launch process.
    • 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
      • 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