Class SimpleRetryTask

  • All Implemented Interfaces:

    
    public class SimpleRetryTask
    extends RetryTask
                        

    Simple implementation of getCallable which stores callable method in the constructor.

    Author:

    Pawel Domas

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      public final long initialDelay
      public final long retryDelay
    • Constructor Summary

      Constructors 
      Constructor Description
      SimpleRetryTask(long initialDelay, long retryDelay, boolean retryOnException, Callable<Boolean> retryJob) Initializes new instance of SimpleRetryTask.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      Callable<Boolean> getCallable() Returns a Callable which is the job to be executed by retry strategy.
      • Methods inherited from class org.jitsi.retry.RetryTask

        getInitialDelay, getRetryDelay, isCancelled, setCancelled, setRetryAfterException, willRetryAfterException
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SimpleRetryTask

        SimpleRetryTask(long initialDelay, long retryDelay, boolean retryOnException, Callable<Boolean> retryJob)
        Initializes new instance of SimpleRetryTask.
        Parameters:
        initialDelay - how long we're going to wait before running task callable for the first time(in ms).
        retryDelay - how often are we going to retry(in ms).
        retryOnException - should we continue retry after callable throws unexpected Exception.
        retryJob - the callable job to be executed on retry.
    • Method Detail

      • getCallable

         Callable<Boolean> getCallable()

        Returns a Callable which is the job to be executed by retry strategy. The task will be retried as long as it returns true or until the job is cancelled.