Example usage for io.vertx.core.http HttpServerOptionsConverter fromJson

List of usage examples for io.vertx.core.http HttpServerOptionsConverter fromJson

Introduction

In this page you can find the example usage for io.vertx.core.http HttpServerOptionsConverter fromJson.

Prototype

static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, HttpServerOptions obj) 

Source Link

Usage

From source file:io.apiman.test.common.echo.EchoServerVertx.java

License:Apache License

private HttpServerOptions getHttpServerOptions(String name) {
    HttpServerOptions options = new HttpServerOptions();
    HttpServerOptionsConverter.fromJson(config().getJsonObject(name, new JsonObject()), options);
    if (JdkSSLEngineOptions.isAlpnAvailable()) {
        options.setUseAlpn(true);/* w w w.j a v  a2  s.  c om*/
    }
    return options;
}

From source file:org.jspare.forvertx.web.transporter.Transporter.java

License:Apache License

/**
 * Builder./*from  w  w w.  j  a va  2s  .  com*/
 *
 * @return the transporter builder
 */
@SneakyThrows(IOException.class)
public static TransporterBuilder builder() {

    // Prepare httpServerOptions default
    HttpServerOptions httpServerOptions = new HttpServerOptions().setTcpKeepAlive(true).setReuseAddress(true);
    if (my(ResourceLoader.class).exist(DEFAULT_HTTP_OPTIONS_JSON_PATH)) {

        String content = my(ResourceLoader.class).readFileToString(DEFAULT_HTTP_OPTIONS_JSON_PATH);
        if (StringUtils.isNotEmpty(content)) {

            HttpServerOptionsConverter.fromJson(Json.decodeValue(content, JsonObject.class), httpServerOptions);
        }
    }

    return new TransporterBuilder().httpServerOptions(httpServerOptions);
}