public void registerOperation(final ListenableFuture<?> future) {
    count.incrementAndGet();
    Futures.addCallback(future, new FutureCallback<Object>() {
      @Override
      public void onSuccess(Object result) {
        onOperationCompletion();
      }

      @Override
      public void onFailure(Throwable t) {
        onOperationCompletion();
      }
    }, MoreExecutors.directExecutor());
  }
public void registerOperation ( final ListenableFuture < ? > future ) { count . incrementAndGet ( ) ; Futures . addCallback ( future , new FutureCallback < Object > ( ) { @ Override public void onSuccess ( Object result ) { onOperationCompletion ( ) ; } @ Override public void onFailure ( Throwable t ) { onOperationCompletion ( ) ; } } , MoreExecutors . directExecutor ( ) ) ; }
Register a new RPC operation. Blocks until the requested resources are available. This method
must be paired with a call to {@link #onOperationCompletion()}.