public V action ( Callable < V > callable ) throws Exception { Exception re ; RetryState retryState = retryStrategy . getRetryState ( ) ; do { try { return callable . call ( ) ; } catch ( Exception e ) { re = e ; if ( Thread . interrupted ( ) || isInterruptTransitively ( e ) ) { re = new InterruptedException ( e . getMessage ( ) ) ; break ; } if ( ! transientExceptionDetector . isTransient ( e ) ) { break ; } } enqueueRetryEvent ( new RetryEvent ( this , retryState , re ) ) ; retryState . delayRetry ( ) ; } while ( retryState . hasRetries ( ) ) ; throw re ; }
Perform the specified action under the defined retry semantics .