Beispiel #1
0
        /// <summary>
        /// Returns the retry strategy for the specified technology.
        /// </summary>
        /// <param name="technology">The techonolgy to get the default retry strategy for.</param>
        /// <returns>The retry strategy for the specified technology.</returns>
        public virtual RetryStrategy GetDefaultRetryStrategy(string technology)
        {
            Guard.ArgumentNotNullOrEmpty(technology, "techonology");
            RetryStrategy defaultStrategy;

            if (!defaultRetryStrategiesMap.TryGetValue(technology, out defaultStrategy))
            {
                defaultStrategy = this.defaultStrategy;
            }
            if (defaultStrategy == null)
            {
                throw new ArgumentOutOfRangeException(string.Format(CultureInfo.CurrentCulture, "Retry strategy not found: {0}", technology));
            }
            return(defaultStrategy);
        }
Beispiel #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:Nevermore.Transient.RetryPolicy`1" /> class with the specified number of retry attempts and parameters defining the progressive delay between retries.
 /// </summary>
 /// <param name="retryStrategy">The strategy to use for this retry policy.</param>
 public RetryPolicy(RetryStrategy retryStrategy) : base((default(T) == null) ? Activator.CreateInstance <T>() : default(T), retryStrategy)
 {
 }