private void deployComponents(Collection<ComponentContext<?>> components, final CountingCompletionHandler<Void> counter) {
    for (final ComponentContext<?> component : components) {
      deployComponent(component, new Handler<AsyncResult<Void>>() {
        @Override
        public void handle(AsyncResult<Void> result) {
          if (result.failed()) {
            counter.fail(result.cause());
          } else {
            data.put(component.address(), Contexts.serialize(component).encode(), new Handler<AsyncResult<String>>() {
              @Override
              public void handle(AsyncResult<String> result) {
                if (result.failed()) {
                  counter.fail(result.cause());
                } else {
                  counter.succeed();
                }
              }
            });
          }
        }
      });
    }
  }
private void deployComponents ( Collection < ComponentContext < ? > > components , final CountingCompletionHandler < Void > counter ) { for ( final ComponentContext < ? > component : components ) { deployComponent ( component , new Handler < AsyncResult < Void > > ( ) { @ Override public void handle ( AsyncResult < Void > result ) { if ( result . failed ( ) ) { counter . fail ( result . cause ( ) ) ; } else { data . put ( component . address ( ) , Contexts . serialize ( component ) . encode ( ) , new Handler < AsyncResult < String > > ( ) { @ Override public void handle ( AsyncResult < String > result ) { if ( result . failed ( ) ) { counter . fail ( result . cause ( ) ) ; } else { counter . succeed ( ) ; } } } ) ; } } } ) ; } }
Deploys all network components.