//- @SortAllDynamic -// public void SortAllDynamic() { if (InitProcessorDataList.Count != InitProcessorDataList.OriginalCount) { InitProcessorDataList = new InitProcessorDataList(InitProcessorDataList.OrderBy(p => p.Priority).ToList()); } if (ProcessorFactoryDataList.Count != ProcessorFactoryDataList.OriginalCount) { ProcessorFactoryDataList = new ProcessorFactoryDataList(ProcessorFactoryDataList.OrderBy(p => p.Priority).ToList()); } if (HandlerFactoryDataList.Count != HandlerFactoryDataList.OriginalCount) { HandlerFactoryDataList = new EndpointFactoryDataList(HandlerFactoryDataList.OrderBy(p => p.Priority).ToList()); } if (SelectionProcessorDataList.Count != SelectionProcessorDataList.OriginalCount) { SelectionProcessorDataList = new SelectionProcessorDataList(SelectionProcessorDataList.OrderBy(p => p.Priority).ToList()); } if (OverrideProcessorDataList.Count != OverrideProcessorDataList.OriginalCount) { OverrideProcessorDataList = new OverrideProcessorDataList(OverrideProcessorDataList.OrderBy(p => p.Priority).ToList()); } if (StateProcessorDataList.Count != StateProcessorDataList.OriginalCount) { StateProcessorDataList = new StateProcessorDataList(StateProcessorDataList.OrderBy(p => p.Priority).ToList()); } if (PostRenderProcessorDataList.Count != PostRenderProcessorDataList.OriginalCount) { PostRenderProcessorDataList = new PostRenderProcessorDataList(PostRenderProcessorDataList.OrderBy(p => p.Priority).ToList()); } }
//- ~RunSelectionProcessing -// internal static IHttpHandler RunSelectionProcessing(HttpContext context, SelectionProcessorDataList dataList) { if (dataList.Count == 0) { return null; } foreach (ProcessorData data in dataList.OrderBy(p => p.Priority)) { String processorType = data.ProcessorType; //+ ProcessorReaderWriterLockSlim.EnterUpgradeableReadLock(); try { SelectionProcessor processor = null; //+ if (!RouteCache.ProcessorCache.ContainsKey(processorType)) { ProcessorReaderWriterLockSlim.EnterWriteLock(); try { if (!RouteCache.ProcessorCache.ContainsKey(processorType)) { processor = ProcessorActivator.Create<SelectionProcessor>(processorType, RouteCache.ProcessorFactoryCache); if (processor == null) { throw new EntityNotFoundException(String.Format(Resource.General_NotFound, processorType)); } RouteCache.ProcessorCache.Add(processorType, processor); } } finally { ProcessorReaderWriterLockSlim.ExitWriteLock(); } } if (processor == null) { processor = RouteCache.ProcessorCache.Get<SelectionProcessor>(processorType); } //+ if (processor != null) { ProcessorReaderWriterLockSlim.EnterWriteLock(); //+ try { if (processor != null) { return processor.Execute(context, data.ParameterArray); } } finally { ProcessorReaderWriterLockSlim.ExitWriteLock(); } } } catch (Exception ex) { if (WebProcessingReportController.Reporter.Initialized) { var map = new Map(); map.Add("Section", "SelectionProcessor"); map.Add("Type", processorType); map.Add("Message", ex.Message); map.Add("Exception Type", ex.GetType().FullName); //+ WebProcessingReportController.Reporter.AddMap(map); } } finally { ProcessorReaderWriterLockSlim.ExitUpgradeableReadLock(); } } //+ return null; }