Package io.vertx.launcher.application
Interface VertxApplicationHooks
-
public interface VertxApplicationHooksMethods invoked by theVertxApplicationat different stages of the launch process.
-
-
Field Summary
Fields Modifier and Type Field Description static VertxApplicationHooksDEFAULT
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default 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>verticleSupplier()Invoked before deploying the main verticle orDeployable.
-
-
-
Field Detail
-
DEFAULT
static final VertxApplicationHooks DEFAULT
-
-
Method Detail
-
afterVertxOptionsParsed
default JsonObject afterVertxOptionsParsed(JsonObject vertxOptions)
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
default JsonObject afterDeploymentOptionsParsed(JsonObject deploymentOptions)
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
default JsonObject afterConfigParsed(JsonObject config)
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
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 theVertxApplicationlaunch process
-
createVertxBuilder
default VertxBuilder createVertxBuilder(VertxOptions options)
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
default void afterVertxStarted(HookContext context)
Invoked after Vert.x has started successfully.- Parameters:
context- exposes objects available at this stage of theVertxApplicationlaunch 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 theVertxApplicationlaunch processt- the failure ornullif Vert.x took too long to start
-
verticleSupplier
default Supplier<? extends Deployable> 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
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 theVertxApplicationlaunch process
-
afterVerticleDeployed
default void afterVerticleDeployed(HookContext context)
Invoked after the verticle has been deployed successfully.- Parameters:
context- exposes objects available at this stage of theVertxApplicationlaunch 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 theVertxApplicationlaunch processt- the failure ornullif 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 theVertxApplicationlaunch process
-
afterVertxStopped
default void afterVertxStopped(HookContext context)
Invoked after Vert.x has stopped successfully.- Parameters:
context- exposes objects available at this stage of theVertxApplicationlaunch 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 theVertxApplicationlaunch processt- the failure ornullif Vert.x took too long to stop
-
-