예제 #1
0
파일: Cache.cs 프로젝트: bnantz/NCS-V1-1
        public Cache(IBackingStore backingStore, CacheCapacityScavengingPolicy scavengingPolicy)
        {
            this.backingStore = backingStore;
            this.scavengingPolicy = scavengingPolicy;

            Hashtable initialItems = backingStore.Load();
            inMemoryCache = Hashtable.Synchronized(initialItems);

            CachingServiceItemTurnoverEvent.SetItemsTotal(Count);
        }
예제 #2
0
파일: Cache.cs 프로젝트: smillea1/NCS-V1-1
        public Cache(IBackingStore backingStore, CacheCapacityScavengingPolicy scavengingPolicy)
        {
            this.backingStore     = backingStore;
            this.scavengingPolicy = scavengingPolicy;

            Hashtable initialItems = backingStore.Load();

            inMemoryCache = Hashtable.Synchronized(initialItems);

            CachingServiceItemTurnoverEvent.SetItemsTotal(Count);
        }
예제 #3
0
		/// <summary>
		/// Initialzie a new instance of a <see cref="Cache"/> class with a backing store, and scavenging policy.
		/// </summary>
		/// <param name="backingStore">The cache backing store.</param>
		/// <param name="scavengingPolicy">The scavenging policy.</param>
		/// <param name="instrumentationProvider">The instrumentation provider.</param>
		public Cache(IBackingStore backingStore, CacheCapacityScavengingPolicy scavengingPolicy, CachingInstrumentationProvider instrumentationProvider)
        {
            this.backingStore = backingStore;
            this.scavengingPolicy = scavengingPolicy;
			this.instrumentationProvider = instrumentationProvider;

            Hashtable initialItems = backingStore.Load();
            inMemoryCache = Hashtable.Synchronized(initialItems);

			this.instrumentationProvider.FireCacheUpdated(initialItems.Count, initialItems.Count);
        }
예제 #4
0
        /// <summary>
        /// Initialzie a new instance of a <see cref="Cache"/> class with a backing store, and scavenging policy.
        /// </summary>
        /// <param name="backingStore">The cache backing store.</param>
        /// <param name="scavengingPolicy">The scavenging policy.</param>
        /// <param name="instrumentationProvider">The instrumentation provider.</param>
        public Cache(IBackingStore backingStore, CacheCapacityScavengingPolicy scavengingPolicy, CachingInstrumentationProvider instrumentationProvider)
        {
            this.backingStore            = backingStore;
            this.scavengingPolicy        = scavengingPolicy;
            this.instrumentationProvider = instrumentationProvider;

            Hashtable initialItems = backingStore.Load();

            inMemoryCache = Hashtable.Synchronized(initialItems);

            this.instrumentationProvider.FireCacheUpdated(initialItems.Count, initialItems.Count);
        }
예제 #5
0
파일: Cache.cs 프로젝트: CrazyTiger/Test
        /// <summary>
        /// </summary>
        /// <param name="backingStore">Резервное хранилище.</param>
        /// <param name="instrumentationProvider">Инструментарий для событий</param>
        public Cache(IBackingStore backingStore, ICachingInstrumentationProvider instrumentationProvider)
        {
            if (backingStore == null) throw new ArgumentNullException("backingStore");
            if (instrumentationProvider == null) throw new ArgumentNullException("instrumentationProvider");

            this.backingStore = backingStore;
            this.instrumentationProvider = instrumentationProvider;

            var initialItems = backingStore.Load();
            inMemoryCache = Hashtable.Synchronized(initialItems);

            this.instrumentationProvider.FireCacheUpdated(initialItems.Count, initialItems.Count);
        }
        /// <summary>
        /// Initialzie a new instance of a <see cref="Cache"/> class with a backing store, and scavenging policy.
        /// </summary>
        /// <param name="backingStore">The cache backing store.</param>
        /// <param name="instrumentationProvider">The instrumentation provider.</param>
        public Cache(IBackingStore backingStore, ICachingInstrumentationProvider instrumentationProvider)
        {
            if (backingStore == null)
            {
                throw new ArgumentNullException("backingStore");
            }
            if (instrumentationProvider == null)
            {
                throw new ArgumentNullException("instrumentationProvider");
            }

            this.backingStore            = backingStore;
            this.instrumentationProvider = instrumentationProvider;

            Hashtable initialItems = backingStore.Load();

            inMemoryCache = Hashtable.Synchronized(initialItems);

            this.instrumentationProvider.FireCacheUpdated(initialItems.Count, initialItems.Count);
        }