Example #1
0
        protected virtual ICacheLayout CreateCacheLayout(ICacheProgress cacheProgress, IDataLoadEventListener listener)
        {
            var pipelineFactory = new CachingPipelineUseCase(cacheProgress);
            var destination     = pipelineFactory.CreateDestinationOnly(listener);

            return(destination.CreateCacheLayout());
        }
Example #2
0
        public ICacheLayout CreateCacheLayout(ILoadProgress loadProgress, ILoadMetadata metadata)
        {
            AssertThatThereIsACacheDataProvider(metadata, metadata.ProcessTasks.Where(p=>!p.IsDisabled));

            var cp = loadProgress.CacheProgress;

            var factory = new CachingPipelineUseCase(cp);
            var destination = factory.CreateDestinationOnly(new ThrowImmediatelyDataLoadEventListener());

            return destination.CreateCacheLayout();
        }
Example #3
0
        /// <summary>
        /// Retrieves the destination component from the caching pipeline associated with the ICacheProgress object. The destination component is required to be an ICacheFileSystemDestination.
        /// </summary>
        /// <param name="cacheProgress"></param>
        /// <returns></returns>
        /// <exception cref="InvalidOperationException">Caching pipeline is not configured properly/doesn't exist</exception>
        private static ICacheFileSystemDestination GetCacheDestinationPipelineComponent(ICacheProgress cacheProgress)
        {
            if (cacheProgress.Pipeline_ID == null)
            {
                throw new InvalidOperationException("This CacheProgress does not have a caching pipeline, please configure one.");
            }

            var factory = new CachingPipelineUseCase(cacheProgress);
            ICacheFileSystemDestination destination;

            try
            {
                destination = factory.CreateDestinationOnly(new ThrowImmediatelyDataLoadEventListener());
            }
            catch (Exception e)
            {
                throw new Exception("We identified that your cache uses pipeline " + cacheProgress.Pipeline + " but we could not instantiate the Pipeline's Destination instance, make sure the pipeline is intact in PipelineDiagramUI.  See inner exception for details", e);
            }

            return(destination);
        }