use of io.vertx.core.json.JsonObject in project vert.x by eclipse.
the class Http2Settings method toJson.
public JsonObject toJson() {
JsonObject json = new JsonObject();
Http2SettingsConverter.toJson(this, json);
return json;
}
use of io.vertx.core.json.JsonObject in project vert.x by eclipse.
the class HttpClientOptions method toJson.
/**
* Convert to JSON
*
* @return the JSON
*/
public JsonObject toJson() {
JsonObject json = super.toJson();
HttpClientOptionsConverter.toJson(this, json);
return json;
}
use of io.vertx.core.json.JsonObject in project vert.x by eclipse.
the class HttpServerOptions method toJson.
/**
* Convert to JSON
*
* @return the JSON
*/
public JsonObject toJson() {
JsonObject json = super.toJson();
HttpServerOptionsConverter.toJson(this, json);
return json;
}
use of io.vertx.core.json.JsonObject in project vert.x by eclipse.
the class Starter method runVerticle.
private void runVerticle(String main, Args args) {
boolean ha = args.map.get("-ha") != null;
boolean clustered = args.map.get("-cluster") != null || ha;
Vertx vertx = startVertx(clustered, ha, args);
if (vertx == null) {
// Throwable should have been logged at this point
return;
}
String sinstances = args.map.get("-instances");
int instances;
if (sinstances != null) {
try {
instances = Integer.parseInt(sinstances);
if (instances != -1 && instances < 1) {
log.error("Invalid number of instances");
displaySyntax();
return;
}
} catch (NumberFormatException e) {
displaySyntax();
return;
}
} else {
instances = 1;
}
String confArg = args.map.get("-conf");
JsonObject conf;
if (confArg != null) {
try (Scanner scanner = new Scanner(new File(confArg)).useDelimiter("\\A")) {
String sconf = scanner.next();
try {
conf = new JsonObject(sconf);
} catch (DecodeException e) {
log.error("Configuration file " + sconf + " does not contain a valid JSON object");
return;
}
} catch (FileNotFoundException e) {
try {
conf = new JsonObject(confArg);
} catch (DecodeException e2) {
log.error("-conf option does not point to a file and is not valid JSON: " + confArg);
return;
}
}
} else {
conf = null;
}
boolean worker = args.map.get("-worker") != null;
String message = (worker) ? "deploying worker verticle" : "deploying verticle";
deploymentOptions = new DeploymentOptions();
configureFromSystemProperties(deploymentOptions, DEPLOYMENT_OPTIONS_PROP_PREFIX);
deploymentOptions.setConfig(conf).setWorker(worker).setHa(ha).setInstances(instances);
beforeDeployingVerticle(deploymentOptions);
vertx.deployVerticle(main, deploymentOptions, createLoggingHandler(message, res -> {
if (res.failed()) {
handleDeployFailed();
}
}));
}
use of io.vertx.core.json.JsonObject in project vert.x by eclipse.
the class AddressResolverOptions method toJson.
public JsonObject toJson() {
JsonObject json = new JsonObject();
AddressResolverOptionsConverter.toJson(this, json);
return json;
}
Aggregations