try {
for (int i = 0; i < instances; i++) {
// Launch the verticle instance
Runnable runner = new Runnable() {
public void run() {
Verticle verticle;
try {
verticle = verticleFactory.createVerticle(main);
} catch (Throwable t) {
handleDeployFailure(t, deploymentID, aggHandler);
return;
}
try {
addVerticle(deployment, verticle, verticleFactory, modID, main);
if (modDir != null) {
setPathAdjustment(modDir);
}
DefaultFutureResult<Void> vr = new DefaultFutureResult<>();
verticle.start(vr);
vr.setHandler(new Handler<AsyncResult<Void>>() {
@Override
public void handle(AsyncResult<Void> ar) {
if (ar.succeeded()) {
aggHandler.complete();