code: public <T> T invokeRetry( Callable<T> invoker )
              throws CStorageException
      {
          int currentTries = 0;
  
          while ( true ) {
  
              currentTries++;
  
              try {
                  if ( currentTries > 1 ) {
                      LOGGER.debug( "Invocation #{}/{}", currentTries, nbTriesMax );
                  }
                  return invoker.call();
  
              } catch ( CRetriableException ex ) {
                  if ( currentTries >= nbTriesMax ) {
                      LOGGER.debug( "Aborting invocation after {} attempts", nbTriesMax );
                      Throwable cause = ex.getCause();
                      if ( cause instanceof CStorageException ) {
                          throw ( CStorageException ) cause;
                      }
                      throw new CStorageException( "Invocation failure", cause );
                  }
  
                  LOGGER.debug( "Catching a CRetriableException, {} out of {} max attempts", currentTries, nbTriesMax );
                  doWait( currentTries, ex.getDelay() );
  
              } catch ( CStorageException ex ) {
                  throw ex;
  
              } catch ( Exception ex ) {
                  throw new CStorageException( "Invocation failure", ex );
              }
          }
      }
docs: Main method to be called by user of this class : calls {@link Callable#call()} until success, non retriable error
  or max trials has been reached.
  
  @param <T> The request result type
  @param invoker The request invoker which execute and validate the request
  @return The request result
  @throws CStorageException Request execution error