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. */