Class VertxBuilder

java.lang.Object
io.vertx.mutiny.core.VertxBuilder
All Implemented Interfaces:
MutinyDelegate

public class VertxBuilder extends Object implements MutinyDelegate
A builder for creating Vert.x instances, allowing to configure Vert.x plugins:
  • metrics
  • tracing
  • cluster manager
Example usage:

   Vertx vertx = Vertx.builder().with(options).withMetrics(metricsFactory).build();
 

NOTE: This class has been automatically generated from the original non Mutiny-ified interface.

Author:
Julien Viet
See Also:
  • VertxBuilder
  • Field Details

  • Constructor Details

    • VertxBuilder

      public VertxBuilder(io.vertx.core.VertxBuilder delegate)
      Create a new instance of VertxBuilder delegating to the given (non-null) instance of VertxBuilder.
    • VertxBuilder

      public VertxBuilder(Object delegate)
  • Method Details

    • getDelegate

      public io.vertx.core.VertxBuilder getDelegate()
      Get the delegate instance.

      This method returns the instance on which this shim is delegating the calls. And so, give you access to the bare API.

      Specified by:
      getDelegate in interface MutinyDelegate
      Returns:
      the delegate instance
    • buildClustered

      @CheckReturnValue public io.smallrye.mutiny.Uni<Vertx> buildClustered()
      Creates a clustered instance.

      The instance is created asynchronously and the returned uni is completed with the result when it is ready.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • VertxBuilder.buildClustered()
    • buildClusteredAndAwait

      public Vertx buildClusteredAndAwait()
      Creates a clustered instance.

      The instance is created asynchronously and the returned underlying uni is completed with the result when it is ready.

      Unlike the bare Vert.x variant, this method returns a Vertx. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Returns:
      The operation result
      See Also:
      • VertxBuilder.buildClustered()
    • buildClusteredAndForget

      public VertxBuilder buildClusteredAndForget()
      Creates a clustered instance.

      The instance is created asynchronously and the returned underlying uni is completed with the result when it is ready.

      Unlike the bare Vert.x variant, this method ignores the Vertx result or any failure.

      Returns:
      The current instance to chain operations if needed.
      See Also:
      • VertxBuilder.buildClustered()
    • with

      public VertxBuilder with(io.vertx.core.VertxOptions options)
      Configure the Vert.x options.
      Parameters:
      options - the Vert.x options
      Returns:
      a reference to this, so the API can be used fluently
    • withMetrics

      public VertxBuilder withMetrics(io.vertx.core.spi.VertxMetricsFactory factory)
      Programmatically set the metrics factory to be used when metrics are enabled.

      Only valid if MetricsOptions#isEnabled = true.

      Normally Vert.x will look on the classpath for a metrics factory implementation, but if you want to set one programmatically you can use this method.

      Parameters:
      factory - the metrics factory
      Returns:
      a reference to this, so the API can be used fluently
    • withTracer

      public VertxBuilder withTracer(io.vertx.core.spi.VertxTracerFactory factory)
      Programmatically set the tracer factory to be used when tracing are enabled.

      Normally Vert.x will look on the classpath for a tracer factory implementation, but if you want to set one programmatically you can use this method.

      Parameters:
      factory - the tracer factory
      Returns:
      a reference to this, so the API can be used fluently
    • withTransport

      public VertxBuilder withTransport(io.vertx.core.transport.Transport transport)
      Programmatically set the transport, this overrides VertxOptions.setPreferNativeTransport(boolean)
      Parameters:
      transport - the transport
      Returns:
      a reference to this, so the API can be used fluently
    • withClusterManager

      public VertxBuilder withClusterManager(io.vertx.core.spi.cluster.ClusterManager clusterManager)
      Programmatically set the cluster manager to be used when clustering.

      Only valid if clustered = true.

      Normally Vert.x will look on the classpath for a cluster manager, but if you want to set one programmatically you can use this method.

      Parameters:
      clusterManager - the cluster manager
      Returns:
      a reference to this, so the API can be used fluently
    • build

      public Vertx build()
      Creates a non clustered instance.
      Returns:
      the instance
    • newInstance

      public static VertxBuilder newInstance(io.vertx.core.VertxBuilder delegate)
      Creates a new instance of the VertxBuilder.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object