Interface VertxApplicationHooks


public interface VertxApplicationHooks
Methods invoked by the VertxApplication at different stages of the launch process.
  • Field Details

  • Method Details

    • afterVertxOptionsParsed

      default JsonObject afterVertxOptionsParsed(JsonObject vertxOptions)
      Invoked after parsing the options parameter. The content can be modified or replaced.
      Parameters:
      vertxOptions - the parsed JSON representation of VertxOptions
      Returns:
      the JSON value to use
    • afterDeploymentOptionsParsed

      default JsonObject afterDeploymentOptionsParsed(JsonObject deploymentOptions)
      Invoked after parsing the deployment-options parameter. The content can be modified or replaced.
      Parameters:
      deploymentOptions - the parsed JSON representation of DeploymentOptions
      Returns:
      the JSON value to use
    • afterConfigParsed

      default JsonObject afterConfigParsed(JsonObject config)
      Invoked after parsing the conf parameter. The content can be modified or replaced.
      Parameters:
      config - the parsed JSON representation of DeploymentOptions.getConfig()
      Returns:
      the JSON value to use
    • 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 Supplier<? extends Deployable> verticleSupplier()
      Invoked before deploying the main verticle or Deployable.

      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