Example usage for io.vertx.core VertxOptions VertxOptions

List of usage examples for io.vertx.core VertxOptions VertxOptions

Introduction

In this page you can find the example usage for io.vertx.core VertxOptions VertxOptions.

Prototype

public VertxOptions(JsonObject json) 

Source Link

Document

Create an instance from a io.vertx.core.json.JsonObject

Usage

From source file:co.runrightfast.vertx.core.impl.VertxServiceImpl.java

License:Apache License

/**
 *
 * @return a copy of the VertxOptions that was used to create the Vertx instance
 *///from   w ww . ja  v  a2  s  . co  m
@Override
public VertxOptions getVertxOptions() {
    final VertxOptions copy = new VertxOptions(vertxOptions);
    final MetricsOptions metricsOptions = vertxOptions.getMetricsOptions();
    if (metricsOptions != null) {
        if (metricsOptions instanceof DropwizardMetricsOptions) {
            copy.setMetricsOptions(new DropwizardMetricsOptions((DropwizardMetricsOptions) metricsOptions));
        } else {
            copy.setMetricsOptions(new DropwizardMetricsOptions(metricsOptions));
        }
    }
    return copy;
}

From source file:co.runrightfast.vertx.core.impl.VertxServiceImpl.java

License:Apache License

private VertxOptions createVertxOptions() {
    final JsonObject vertxJsonObject = JsonUtils
            .toVertxJsonObject(ConfigUtils.toJsonObject(config.getConfig("VertxOptions")));
    vertxOptions = new VertxOptions(vertxJsonObject);
    getWeaveClusterHostIPAddress(config).ifPresent(vertxOptions::setClusterHost);

    if (vertxOptions.getMetricsOptions() != null && vertxOptions.getMetricsOptions().isEnabled()) {
        configureMetricsOptions();// w  w  w . j  av  a  2  s  .  c  o  m
    }

    if (vertxOptions.isClustered()) {
        configureClusterManager();
    }

    return vertxOptions;
}

From source file:me.bayes.vertx.spring.boot.VertxAutoConfiguration.java

License:Apache License

@Bean
public VertxOptions vertxOptions(final VertxProperties properties,
        final AddressResolverOptions addressResolverOptions) {

    final String propertyJson = Json.encode(properties);
    LOG.info("Loaded vertx properties '{}'.", propertyJson);

    final JsonObject config = new JsonObject(propertyJson);

    final VertxOptions options = new VertxOptions(config);
    options.setAddressResolverOptions(addressResolverOptions);

    return options;
}