Java 类io.vertx.core.impl.Deployment 实例源码

项目:Karaf-Vertx    文件:VerticlesList.java   
@Override
public Object execute() throws Exception {

    ShellTable table = new ShellTable();

    table.column("ID");
    table.column("Identifier");
    table.column("Options");

    getVertxService().deploymentIDs().forEach(id -> { 
            Deployment deployment = ((VertxInternal)getVertxService()).getDeployment(id);
            Row row = table.addRow();
            row.addContent(id, deployment.verticleIdentifier(), deployment.deploymentOptions().toJson());
        }
    );

    try {
        table.print(System.out);
    } catch (Throwable t)  {
        System.err.println("FAILED to write table");
    }

    return null;
}
项目:vertx-service-factory    文件:Verticle3.java   
@Override
public void start() throws Exception {

  vertx.runOnContext(v -> {
    List<String> extraCP = Arrays.asList("blah", "wibble");
    DeploymentOptions expected = new DeploymentOptions().setConfig(new JsonObject().put("foo", "bar"))
      .setWorker(true).setIsolationGroup("mygroup").setExtraClasspath(extraCP);
    Deployment dep = ((VertxInternal) vertx).getDeployment(Vertx.currentContext().deploymentID());
    vertx.eventBus().publish("moduleStarted", expected.equals(dep.deploymentOptions()));
  });
}