Top Description Methods
io.vertx.core

public Interface VertxBuilder

Annotations
@VertxGen
Imports
io.vertx.codegen.annotations.Fluent, .GenIgnore, .VertxGen, io.vertx.core.metrics.MetricsOptions, io.vertx.core.spi.VertxMetricsFactory, .VertxTracerFactory, io.vertx.core.spi.cluster.ClusterManager, java.util.Objects

A builder for creating Vert.x instances, allowing to configure Vert.x plugins: Example usage:

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

Method Summary

Modifier and TypeMethod and Description
public Vertx

Returns:

the instance
build
()

Creates a non clustered instance.

public Future<Vertx>

Returns:

a future completed with the clustered vertx
buildClustered
()

Creates a clustered instance.

public default void

Returns:

a future completed with the clustered vertx
buildClustered
(Handler<AsyncResult<Vertx>> handler)

Creates a clustered instance.

public VertxBuilder

Returns:

a reference to this, so the API can be used fluently
with
(VertxOptions
the Vert.x options
options
)

Configure the Vert.x options.

public VertxBuilder

Returns:

a reference to this, so the API can be used fluently
withClusterManager
(ClusterManager
the cluster manager
clusterManager
)

Programmatically set the cluster manager to be used when clustering.

public VertxBuilder

Returns:

a reference to this, so the API can be used fluently
withMetrics
(VertxMetricsFactory
the metrics factory
factory
)

Programmatically set the metrics factory to be used when metrics are enabled.

public VertxBuilder

Returns:

a reference to this, so the API can be used fluently
withTracer
(VertxTracerFactory
the tracer factory
factory
)

Programmatically set the tracer factory to be used when tracing are enabled.

Method Detail

buildback to summary
public Vertx build()

Creates a non clustered instance.

Returns:Vertx

the instance

buildClusteredback to summary
public Future<Vertx> buildClustered()

Creates a clustered instance.

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

Returns:Future<Vertx>

a future completed with the clustered vertx

buildClusteredback to summary
public default void buildClustered(Handler<AsyncResult<Vertx>> handler)

Creates a clustered instance.

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

Returns:void

a future completed with the clustered vertx

withback to summary
public VertxBuilder with(VertxOptions options)

Configure the Vert.x options.

Parameters
options:VertxOptions

the Vert.x options

Returns:VertxBuilder

a reference to this, so the API can be used fluently

Annotations
@Fluent
withClusterManagerback to summary
public VertxBuilder withClusterManager(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:ClusterManager

the cluster manager

Returns:VertxBuilder

a reference to this, so the API can be used fluently

Annotations
@GenIgnore:permitted-type
@Fluent
withMetricsback to summary
public VertxBuilder withMetrics(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:VertxMetricsFactory

the metrics factory

Returns:VertxBuilder

a reference to this, so the API can be used fluently

Annotations
@GenIgnore:permitted-type
@Fluent
withTracerback to summary
public VertxBuilder withTracer(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:VertxTracerFactory

the tracer factory

Returns:VertxBuilder

a reference to this, so the API can be used fluently

Annotations
@GenIgnore:permitted-type
@Fluent