Esempio n. 1
0
        protected override Type GetConfigurationType(string policyName)
        {
            ExceptionHandlingConfigurationView exceptionHandlingConfigurationView = new ExceptionHandlingConfigurationView(ConfigurationContext);
            ExceptionPolicyData policy = exceptionHandlingConfigurationView.GetExceptionPolicyData(policyName);

            return(GetType(policy.TypeName));
        }
Esempio n. 2
0
        private void Initialize(ConfigurationContext context, string policyName)
        {
            ExceptionHandlingConfigurationView exceptionHandlingConfigurationView = new ExceptionHandlingConfigurationView(context);
            ExceptionPolicyData policyData = exceptionHandlingConfigurationView.GetExceptionPolicyData(policyName);

            this.AddPolicyEntriesToCache(policyData, exceptionHandlingConfigurationView.ConfigurationContext);
        }
Esempio n. 3
0
        /// <summary>
        /// <para>Initializes the provider with a <see cref="ExceptionHandlingConfigurationView"/>.</para>
        /// </summary>
        /// <param name="configurationView">
        /// <para>A <see cref="ExceptionHandlingConfigurationView"/> object.</para>
        /// </param>
        public override void Initialize(ConfigurationView configurationView)
        {
            ArgumentValidation.CheckForNullReference(configurationView, "configurationView");
            ArgumentValidation.CheckExpectedType(configurationView, typeof(ExceptionHandlingConfigurationView));

            ExceptionHandlingConfigurationView exceptionHandlingConfigurationView = (ExceptionHandlingConfigurationView)configurationView;
            ExceptionHandlerData exceptionHandlerData = exceptionHandlingConfigurationView.GetExceptionHandlerData(CurrentPolicyName, CurrentExceptionTypeName, ConfigurationName);

            ArgumentValidation.CheckExpectedType(exceptionHandlerData, typeof(ReplaceHandlerData));

            replaceHandlerData = (ReplaceHandlerData)exceptionHandlerData;
        }
        /// <summary>
        /// Creates all configured <see cref="IExceptionHandler"/> objects.
        /// </summary>
        /// <param name="policyName"><para>The policy name to create the handler.</para></param>
        /// <param name="exceptionTypeName"><para>The type of exception requested to be handled.</para></param>
        /// <returns>An array of <see cref="IExceptionHandler"/> objects.</returns>
        public IExceptionHandler[] CreateExceptionHandlers(string policyName, string exceptionTypeName)
        {
            ValidatePolicyAndExceptionType(policyName, exceptionTypeName);

            this.policyName        = policyName;
            this.exceptionTypeName = exceptionTypeName;
            ExceptionHandlingConfigurationView exceptionHandlingConfigurationView = (ExceptionHandlingConfigurationView)CreateConfigurationView();
            ExceptionHandlerDataCollection     handlers = exceptionHandlingConfigurationView.GetExceptionHandlerDataCollection(policyName, exceptionTypeName);

            IExceptionHandler[] exceptionHandlers = new IExceptionHandler[handlers.Count];
            int index = 0;

            foreach (ExceptionHandlerData handler in handlers)
            {
                exceptionHandlers[index++] = CreateExceptionHandler(policyName, exceptionTypeName, handler.Name);
            }
            return(exceptionHandlers);
        }
        private ExceptionHandlerData GetExceptionHandlerData(string handlerName)
        {
            ExceptionHandlingConfigurationView exceptionHandlingConfigurationView = (ExceptionHandlingConfigurationView)CreateConfigurationView();

            return(exceptionHandlingConfigurationView.GetExceptionHandlerData(policyName, exceptionTypeName, handlerName));
        }
Esempio n. 6
0
 protected override Type GetConfigurationType(string policyName)
 {
     ExceptionHandlingConfigurationView exceptionHandlingConfigurationView = new ExceptionHandlingConfigurationView(ConfigurationContext);
     ExceptionPolicyData policy = exceptionHandlingConfigurationView.GetExceptionPolicyData(policyName);
     return GetType(policy.TypeName);
 }
Esempio n. 7
0
 private void Initialize(ConfigurationContext context, string policyName)
 {
     ExceptionHandlingConfigurationView exceptionHandlingConfigurationView = new ExceptionHandlingConfigurationView(context);
     ExceptionPolicyData policyData = exceptionHandlingConfigurationView.GetExceptionPolicyData(policyName);
     this.AddPolicyEntriesToCache(policyData, exceptionHandlingConfigurationView.ConfigurationContext);
 }