Class Retryable<T>

  • Type Parameters:
    T - Result type.
    All Implemented Interfaces:
    java.util.concurrent.Callable<T>

    public class Retryable<T>
    extends java.lang.Object
    implements java.util.concurrent.Callable<T>
    Wrapper of any Callable which retries call method execution based on provided RetryPolicy.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.concurrent.Callable<T> callable  
      private RetryContext context  
      private static org.slf4j.Logger log  
    • Constructor Summary

      Constructors 
      Constructor Description
      Retryable​(java.util.concurrent.Callable<T> callable, ClientPolicy policy)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      T call()  
      • Methods inherited from class java.lang.Object

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

      • log

        private static org.slf4j.Logger log
      • callable

        private java.util.concurrent.Callable<T> callable
    • Constructor Detail

      • Retryable

        public Retryable​(java.util.concurrent.Callable<T> callable,
                         ClientPolicy policy)
    • Method Detail

      • call

        public T call()
               throws java.lang.Exception
        Specified by:
        call in interface java.util.concurrent.Callable<T>
        Throws:
        java.lang.Exception