Esempio n. 1
0
 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);
     }
 }
Esempio n. 2
0
 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);
     }
 }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
 /// <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));
 }
Esempio n. 5
0
 /// <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));
 }
Esempio n. 6
0
 /// <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));
 }
Esempio n. 7
0
 /// <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));
 }
Esempio n. 8
0
 /// <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);
 }
Esempio n. 9
0
 /// <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)
 {
 }