Search in sources :

Example 1 with SimpleJsonObject

use of io.servicecomb.foundation.vertx.SimpleJsonObject in project java-chassis by ServiceComb.

the class HighwayTransport method init.

public boolean init() throws Exception {
    HighwayCodec.setHighwayTransport(this);
    DeploymentOptions deployOptions = new DeploymentOptions().setInstances(HighwayConfig.getServerThreadCount());
    setListenAddressWithoutSchema(HighwayConfig.getAddress(), Collections.singletonMap(TcpConst.LOGIN, "true"));
    SimpleJsonObject json = new SimpleJsonObject();
    json.put(ENDPOINT_KEY, getEndpoint());
    deployOptions.setConfig(json);
    return VertxUtils.blockDeploy(transportVertx, HighwayServerVerticle.class, deployOptions);
}
Also used : DeploymentOptions(io.vertx.core.DeploymentOptions) SimpleJsonObject(io.servicecomb.foundation.vertx.SimpleJsonObject)

Example 2 with SimpleJsonObject

use of io.servicecomb.foundation.vertx.SimpleJsonObject in project java-chassis by ServiceComb.

the class VertxRestTransport method init.

@Override
public boolean init() throws Exception {
    // 部署transport server
    DeploymentOptions options = new DeploymentOptions().setInstances(TransportConfig.getThreadCount());
    setListenAddressWithoutSchema(TransportConfig.getAddress());
    SimpleJsonObject json = new SimpleJsonObject();
    json.put(ENDPOINT_KEY, getEndpoint());
    options.setConfig(json);
    return VertxUtils.blockDeploy(transportVertx, RestServerVerticle.class, options);
}
Also used : DeploymentOptions(io.vertx.core.DeploymentOptions) SimpleJsonObject(io.servicecomb.foundation.vertx.SimpleJsonObject)

Aggregations

SimpleJsonObject (io.servicecomb.foundation.vertx.SimpleJsonObject)2 DeploymentOptions (io.vertx.core.DeploymentOptions)2