Interface VertxApplicationHooks
public interface VertxApplicationHooks
Methods invoked by the
VertxApplication at different stages of the launch process.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault JsonObjectafterConfigParsed(JsonObject config) Invoked after parsing theconfparameter.default JsonObjectafterDeploymentOptionsParsed(JsonObject deploymentOptions) Invoked after parsing thedeployment-optionsparameter.default voidafterFailureToDeployVerticle(HookContext context, Throwable t) Invoked after the verticle has failed to be deployed.default voidafterFailureToStartVertx(HookContext context, Throwable t) Invoked after Vert.x has failed to start.default voidafterFailureToStopVertx(HookContext context, Throwable t) Invoked after Vert.x has failed to stop.default voidafterVerticleDeployed(HookContext context) Invoked after the verticle has been deployed successfully.default JsonObjectafterVertxOptionsParsed(JsonObject vertxOptions) Invoked after parsing theoptionsparameter.default voidafterVertxStarted(HookContext context) Invoked after Vert.x has started successfully.default voidafterVertxStopped(HookContext context) Invoked after Vert.x has stopped successfully.default voidbeforeDeployingVerticle(HookContext context) Invoked before deploying the main verticle.default voidbeforeStartingVertx(HookContext context) Invoked before starting Vert.x.default voidbeforeStoppingVertx(HookContext context) Invoked before stopping Vert.x.default VertxBuildercreateVertxBuilder(VertxOptions options) Default implementation for theVertxBuildercreation.default Supplier<? extends Deployable> Invoked before deploying the main verticle orDeployable.
-
Field Details
-
DEFAULT
-
-
Method Details
-
afterVertxOptionsParsed
Invoked after parsing theoptionsparameter. The content can be modified or replaced.- Parameters:
vertxOptions- the parsed JSON representation ofVertxOptions- Returns:
- the JSON value to use
-
afterDeploymentOptionsParsed
Invoked after parsing thedeployment-optionsparameter. The content can be modified or replaced.- Parameters:
deploymentOptions- the parsed JSON representation ofDeploymentOptions- Returns:
- the JSON value to use
-
afterConfigParsed
Invoked after parsing theconfparameter. The content can be modified or replaced.- Parameters:
config- the parsed JSON representation ofDeploymentOptions.getConfig()- Returns:
- the JSON value to use
-
beforeStartingVertx
Invoked before starting Vert.x.At this stage the
HookContext.vertxOptions()can still be modified.- Parameters:
context- exposes objects available at this stage of theVertxApplicationlaunch process
-
createVertxBuilder
Default implementation for theVertxBuildercreation.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
Invoked after Vert.x has started successfully.- Parameters:
context- exposes objects available at this stage of theVertxApplicationlaunch process
-
afterFailureToStartVertx
Invoked after Vert.x has failed to start.- Parameters:
context- exposes objects available at this stage of theVertxApplicationlaunch processt- the failure ornullif Vert.x took too long to start
-
verticleSupplier
Invoked before deploying the main verticle orDeployable.If the implementation returns a non-
nullsupplier, 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'sMETA-INF/MANIFEST.MFfile. -
beforeDeployingVerticle
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 theVertxApplicationlaunch process
-
afterVerticleDeployed
Invoked after the verticle has been deployed successfully.- Parameters:
context- exposes objects available at this stage of theVertxApplicationlaunch process
-
afterFailureToDeployVerticle
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 theVertxApplicationlaunch processt- the failure ornullif the verticle took too long to start
-
beforeStoppingVertx
Invoked before stopping Vert.x.- Parameters:
context- exposes objects available at this stage of theVertxApplicationlaunch process
-
afterVertxStopped
Invoked after Vert.x has stopped successfully.- Parameters:
context- exposes objects available at this stage of theVertxApplicationlaunch process
-
afterFailureToStopVertx
Invoked after Vert.x has failed to stop.- Parameters:
context- exposes objects available at this stage of theVertxApplicationlaunch processt- the failure ornullif Vert.x took too long to stop
-