private void DoOnErrorInterceptors <T>(IRetryCallback <T> callback, IRetryContext context, Exception throwable) { for (var i = this.listeners.Length; i-- > 0;) { this.listeners[i].OnError(context, callback, throwable); } }
private void DoCloseInterceptors <T>(IRetryCallback <T> callback, IRetryContext context, Exception lastException) { for (var i = this.listeners.Length; i-- > 0;) { this.listeners[i].Close(context, callback, lastException); } }
private bool DoOpenInterceptors <T>(IRetryCallback <T> callback, IRetryContext context) { var result = true; for (var i = 0; i < this.listeners.Length; i++) { result = result && this.listeners[i].Open(context, callback); } return(result); }
/// <summary>The execute.</summary> /// <param name="retryCallback">The retry callback.</param> /// <returns>The T.</returns> /// <typeparam name="T">Type T.</typeparam> public T Execute <T>(IRetryCallback <T> retryCallback) { return(this.DoExecute <T>(retryCallback, null, null)); }
/// <summary>The execute.</summary> /// <param name="retryCallback">The retry callback.</param> /// <param name="recoveryCallback">The recovery callback.</param> /// <param name="retryState">The retry state.</param> /// <returns>The T.</returns> /// <typeparam name="T">Type T.</typeparam> public T Execute <T>(IRetryCallback <T> retryCallback, Func <IRetryContext, T> recoveryCallback, IRetryState retryState) { return(this.DoExecute <T>(retryCallback, recoveryCallback, retryState)); }
/// <summary>The execute.</summary> /// <param name="retryCallback">The retry callback.</param> /// <param name="retryState">The retry state.</param> /// <returns>The T.</returns> /// <typeparam name="T">Type T.</typeparam> public T Execute <T>(IRetryCallback <T> retryCallback, IRetryState retryState) { return(this.DoExecute <T>(retryCallback, null, retryState)); }
/// <summary>The execute.</summary> /// <param name="retryCallback">The retry callback.</param> /// <param name="recoveryCallback">The recovery callback.</param> /// <returns>The T.</returns> /// <typeparam name="T">Type T.</typeparam> public T Execute <T>(IRetryCallback <T> retryCallback, Func <IRetryContext, T> recoveryCallback) { return(this.DoExecute <T>(retryCallback, recoveryCallback, null)); }
/// <summary>The open.</summary> /// <param name="context">The context.</param> /// <param name="callback">The callback.</param> /// <returns>The System.Boolean.</returns> /// <typeparam name="T">Type T.</typeparam> public virtual bool Open <T>(IRetryContext context, IRetryCallback <T> callback) { return(true); }
/// <summary>The on error.</summary> /// <param name="context">The context.</param> /// <param name="callback">The callback.</param> /// <param name="throwable">The throwable.</param> /// <typeparam name="T">Type T.</typeparam> public virtual void OnError <T>(IRetryContext context, IRetryCallback <T> callback, Exception throwable) { }