core/src/main/java/org/infinispan/remoting/transport/RetryOnFailureXSiteCommand.java
/**
    * Invokes remotely the command using the {@code Transport} passed as parameter.
    *
    * @param transport              the {@link org.infinispan.remoting.transport.Transport} to use.
    * @param waitTimeBetweenRetries the waiting time if the command fails before retrying it.
    * @param unit                   the {@link java.util.concurrent.TimeUnit} of the waiting time.
    * @throws Throwable if the maximum retries is reached (defined by the {@link org.infinispan.remoting.transport.RetryOnFailureXSiteCommand.RetryPolicy},
    *                   the last exception occurred is thrown.
    */
Invokes remotely the command using the  Transport passed as parameter.
@param transport              the  org.infinispan.remoting.transport.Transport to use.
@param waitTimeBetweenRetries the waiting time if the command fails before retrying it.
@param unit                   the  java.util.concurrent.TimeUnit of the waiting time.
@throws Throwable if the maximum retries is reached (defined by the  org.infinispan.remoting.transport.RetryOnFailureXSiteCommand.RetryPolicy,
the last exception occurred is thrown.
Invokes remotely the command using the Transport passed as parameter . @param transport the org . infinispan . remoting . transport . Transport to use . @param waitTimeBetweenRetries the waiting time if the command fails before retrying it . @param unit the java . util . concurrent . TimeUnit of the waiting time . @throws Throwable if the maximum retries is reached ( defined by the org . infinispan . remoting . transport . RetryOnFailureXSiteCommand . RetryPolicy the last exception occurred is thrown .
public void execute(Transport transport, long waitTimeBetweenRetries, TimeUnit unit) throws Throwable {
      if (backups.isEmpty()) {
         if (debug) {
            log.debugf("Executing '%s' but backup list is empty.", this);
         }
         return;
      }
      assertNotNull(transport, "Transport");
      assertNotNull(unit, "TimeUnit");
      assertGreaterThanZero(waitTimeBetweenRetries, "WaitTimeBetweenRetries");
      do {
         if (trace) {
            log.tracef("Sending %s to %s", command, backups);
         }
         BackupResponse response = transport.backupRemotely(backups, command);
         response.waitForBackupToFinish();
         Throwable throwable = extractThrowable(response);
         if (throwable == null) {
            if (trace) {
               log.trace("Successfull Response received.");
            }
            return;
         } else if (!retryPolicy.retry(throwable, transport)) {
            if (trace) {
               log.tracef("Exception Response received. Exception is %s", throwable);
            }
            throw throwable;
         }
         unit.sleep(waitTimeBetweenRetries);
      } while (true);
   }
public void execute ( Transport transport , long waitTimeBetweenRetries , TimeUnit unit ) throws Throwable { if ( backups . isEmpty ( ) ) { if ( debug ) { log . debugf ( "Executing '%s' but backup list is empty." , this ) ; } return ; } assertNotNull ( transport , "Transport" ) ; assertNotNull ( unit , "TimeUnit" ) ; assertGreaterThanZero ( waitTimeBetweenRetries , "WaitTimeBetweenRetries" ) ; do { if ( trace ) { log . tracef ( "Sending %s to %s" , command , backups ) ; } BackupResponse response = transport . backupRemotely ( backups , command ) ; response . waitForBackupToFinish ( ) ; Throwable throwable = extractThrowable ( response ) ; if ( throwable == null ) { if ( trace ) { log . trace ( "Successfull Response received." ) ; } return ; } else if ( ! retryPolicy . retry ( throwable , transport ) ) { if ( trace ) { log . tracef ( "Exception Response received. Exception is %s" , throwable ) ; } throw throwable ; } unit . sleep ( waitTimeBetweenRetries ) ; } while ( true ) ; }
Invokes remotely the command using the {@code Transport} passed as parameter.
Invokes remotely the command using the { @code Transport } passed as parameter .