/// <summary> /// Initializes a new instance of the RoutingServiceUrlProvider class. /// </summary> /// <param name="serviceUrl">A url to the load-balancing web service.</param> /// <param name="serverTitle">A title of the server to use load-balancing for.</param> /// <param name="certificateValidationSettings">The reference to the certificate /// validation settings object.</param> public RoutingServiceUrlProvider( string serviceUrl, string serverTitle, ICertificateValidationSettings certificateValidationSettings) { Debug.Assert(serviceUrl != null, "Expects non-null serviceUrl"); Debug.Assert(serverTitle != null, "Expects non-null serverTitle"); Debug.Assert( certificateValidationSettings != null, "Expects non-null certificateValidationSettings"); _serviceUrl = serviceUrl; _serverTitle = serverTitle; var uri = new Uri(serviceUrl); _serviceScheme = uri.Scheme; _certificateValidationSettings = certificateValidationSettings; _serviceWrapper = new RetriableInvocationWrapper( MAX_RETRY_COUNT, _PrepareForRetry, _TranslateExceptions); }
/// <summary> /// Invokes the specified action using the specified invokation wrapper /// by turning action into function returning nothing. /// </summary> /// <param name="wrapper">The service wrapper to be used for invoking the /// specified action.</param> /// <param name="invokationTarget">The action to be invoked.</param> public static void Invoke( this IInvocationWrapper wrapper, Action invokationTarget) { wrapper.Invoke(invokationTarget.ToFunc()); }