List of usage examples for io.vertx.core.http HttpServerOptionsConverter fromJson
static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, HttpServerOptions obj)
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); }