code: private void deployInstances(List<InstanceContext> instances, final Handler<AsyncResult<Void>> doneHandler) {
      final CountingCompletionHandler<Void> counter = new CountingCompletionHandler<Void>(instances.size()).setHandler(doneHandler);
      for (final InstanceContext instance : instances) {
        // Before deploying the instance, check if the instance is already deployed in
        // the network's cluster.
        deploymentIDs.get(instance.address(), new Handler<AsyncResult<String>>() {
          @Override
          public void handle(AsyncResult<String> result) {
            if (result.failed()) {
              counter.fail(result.cause());
            } else if (result.result() == null) {
              // If no deployment ID has been assigned to the instance then that means it hasn't
              // yet been deployed. Deploy the instance.
              deployInstance(instance, counter);
            } else {
              // Even if the instance is already deployed, update its context in the cluster.
              // It's possible that the instance's connections could have changed with the update.
              data.put(instance.address(), Contexts.serialize(instance).encode(), new Handler<AsyncResult<String>>() {
                @Override
                public void handle(AsyncResult<String> result) {
                  if (result.failed()) {
                    counter.fail(result.cause());
                  } else {
                    counter.succeed();
                  }
                }
              });
            }
          }
        });
      }
    }
docs: Deploys all network component instances.