From 83c72a4e4cca3f546a9d05b0e4b1109d4dc24e96 Mon Sep 17 00:00:00 2001 From: Thomas Segismont Date: Mon, 26 Aug 2024 18:33:42 +0200 Subject: [PATCH] Revert "Hook for VertxBuilder customization" This reverts commit 3f930dc2bb3c6c53473e1bf914b07a734f93930a. --- .../impl/launcher/VertxLifecycleHooks.java | 14 -------------- .../impl/launcher/commands/BareCommand.java | 19 +++++++++---------- 2 files changed, 9 insertions(+), 24 deletions(-) diff --git a/src/main/java/io/vertx/core/impl/launcher/VertxLifecycleHooks.java b/src/main/java/io/vertx/core/impl/launcher/VertxLifecycleHooks.java index 33619befb5f..4549e2cc02a 100644 --- a/src/main/java/io/vertx/core/impl/launcher/VertxLifecycleHooks.java +++ b/src/main/java/io/vertx/core/impl/launcher/VertxLifecycleHooks.java @@ -14,9 +14,7 @@ import io.vertx.core.DeploymentOptions; import io.vertx.core.Vertx; import io.vertx.core.VertxOptions; -import io.vertx.core.impl.VertxBuilder; import io.vertx.core.json.JsonObject; -import io.vertx.core.spi.tracing.VertxTracer; /** * Interface that let sub-classes of launcher to be notified on different events. @@ -33,18 +31,6 @@ public interface VertxLifecycleHooks { */ void afterConfigParsed(JsonObject config); - /** - * Default implementation for the {@link VertxBuilder} creation. - *

- * This can be overridden in order to customize, for example, the tracer, with {@link VertxBuilder#tracer(VertxTracer)}. - * - * @param config the Vert.x options to use, in JSON format - * @return the Vert.x builder instance - */ - default VertxBuilder createVertxBuilder(JsonObject config) { - return config == null ? new VertxBuilder() : new VertxBuilder(config); - } - /** * Hook for sub-classes of the {@link io.vertx.core.Launcher} class before the vertx instance is started. Options * can still be updated. diff --git a/src/main/java/io/vertx/core/impl/launcher/commands/BareCommand.java b/src/main/java/io/vertx/core/impl/launcher/commands/BareCommand.java index dcd1815b09c..62ae8d998a2 100644 --- a/src/main/java/io/vertx/core/impl/launcher/commands/BareCommand.java +++ b/src/main/java/io/vertx/core/impl/launcher/commands/BareCommand.java @@ -201,8 +201,15 @@ public void run(Runnable action) { protected Vertx startVertx() { JsonObject optionsJson = getJsonFromFileOrString(vertxOptions, "options"); - EventBusOptions eventBusOptions = optionsJson == null ? getEventBusOptions() : getEventBusOptions(optionsJson.getJsonObject("eventBusOptions")); - VertxBuilder builder = createVertxBuilder(optionsJson); + EventBusOptions eventBusOptions; + VertxBuilder builder; + if (optionsJson == null) { + eventBusOptions = getEventBusOptions(); + builder = new VertxBuilder(); + } else { + eventBusOptions = getEventBusOptions(optionsJson.getJsonObject("eventBusOptions")); + builder = new VertxBuilder(optionsJson); + } options = builder.options(); options.setEventBusOptions(eventBusOptions); @@ -331,14 +338,6 @@ protected void beforeStartingVertx(VertxOptions options) { } } - protected VertxBuilder createVertxBuilder(JsonObject config) { - Object main = executionContext.main(); - if (main instanceof VertxLifecycleHooks) { - return ((VertxLifecycleHooks) main).createVertxBuilder(config); - } - return new VertxBuilder(config); - } - /** * @return the event bus options. */