Beispiel #1
0
        public RmsLicenseStoreManager(string path, int maxCount, RmsPerformanceCounters perfCounters)
        {
            ICachePerformanceCounters cachePerformanceCounters = null;

            if (perfCounters == null)
            {
                this.perfCounters = NoopMruDictionaryPerfCounters.Instance;
            }
            else
            {
                this.perfCounters        = perfCounters.LicenseStorePerfCounters;
                cachePerformanceCounters = perfCounters.LicenseStorePerfCounters;
            }
            this.licenseMap       = new RmsLicenseStoreInfoMap(path, maxCount, this.perfCounters);
            this.cache            = new Cache <MultiValueKey, TenantLicensePair>(RmsClientManager.AppSettings.RacClcCacheSizeInBytes, RmsClientManager.AppSettings.RacClcCacheExpirationInterval, TimeSpan.Zero, null, cachePerformanceCounters);
            this.cache.OnRemoved += RmsLicenseStoreManager.CacheOnRemoved;
        }
Beispiel #2
0
 public AutoRefreshCache(long cacheSizeInBytes, TimeSpan cacheExpirationInterval, TimeSpan cacheCleanupInterval, TimeSpan cachePurgeInterval, TimeSpan refreshInterval, ICacheTracer <K> tracer, ICachePerformanceCounters perfCounters, AutoRefreshCache <K, V, StateType> .CreateEntryDelegate createEntry)
 {
     if (createEntry == null)
     {
         throw new ArgumentNullException("createEntry");
     }
     this.createEntry                = createEntry;
     this.tracer                     = tracer;
     this.cache                      = new Cache <K, V>(cacheSizeInBytes, cacheExpirationInterval, cacheCleanupInterval, cachePurgeInterval, tracer, perfCounters);
     this.itemsToRefresh             = new List <K>();
     this.refreshExpiredEntriesTimer = new GuardedTimer(new TimerCallback(this.RefreshExpiredEntries), null, refreshInterval);
     for (int i = 0; i < this.groupsInADLookupSyncObjects.Length; i++)
     {
         this.groupsInADLookupSyncObjects[i] = new object();
     }
 }
Beispiel #3
0
 public TenantConfigurationCache(long cacheSize, TimeSpan cacheExpirationInterval, TimeSpan cacheCleanupInterval, ICacheTracer <OrganizationId> tracer, ICachePerformanceCounters perfCounters) : this(cacheSize, cacheExpirationInterval, cacheCleanupInterval, Cache <OrganizationId, TSettings> .DefaultPurgeInterval, tracer, perfCounters)
 {
 }
Beispiel #4
0
 public TenantConfigurationCache(long cacheSize, TimeSpan cacheExpirationInterval, TimeSpan cacheCleanupInterval, TimeSpan cachePurgeInterval, ICacheTracer <OrganizationId> tracer, ICachePerformanceCounters perfCounters)
 {
     this.cache            = new Cache <OrganizationId, TSettings>(cacheSize, cacheExpirationInterval, cacheCleanupInterval, cachePurgeInterval, tracer, perfCounters);
     this.cache.OnRemoved += this.HandleCacheItemRemoved;
 }