Пример #1
0
        public void CreateRegionWithTallyLoader(ScopeType scope)
        {
            AttributesFactory af = new AttributesFactory();

            af.SetCacheLoader(m_ldr);
            af.SetScope(scope);
            af.SetCachingEnabled(true);

            m_region = CacheHelper.CreateRegion(TestRegion,
                                                af.CreateRegionAttributes());
        }
Пример #2
0
        public void RegionThreeLoadEntries(int num)
        {
            AttributesFactory af = new AttributesFactory();

            af.SetScope(ScopeType.Local);
            af.SetCacheLoader(m_ldr);
            m_region = CacheHelper.CreateRegion(TestRegion, af.CreateRegionAttributes());
            m_ldr.Reset();
            Thread.Sleep(100);
            DoGets(m_region, num);
            Assert.AreEqual(num, m_ldr.Loads);
            IGFSerializable[] arr = m_region.GetKeys();
            Assert.AreEqual(num, arr.Length);
        }
Пример #3
0
 protected virtual void SetCallbacks(AttributesFactory attributesFactory)
 {
     if (cacheListener != null)
     {
         foreach (ICacheListener listener in cacheListener)
         {
             attributesFactory.SetCacheListener(listener);
         }
     }
     if (cacheLoader != null)
     {
         attributesFactory.SetCacheLoader(cacheLoader);
     }
     if (cacheWriter != null)
     {
         attributesFactory.SetCacheWriter(cacheWriter);
     }
 }
 protected virtual void SetCallbacks(AttributesFactory attributesFactory)
 {
     if (cacheListener != null)
     {
         foreach (ICacheListener listener in cacheListener)
         {
             attributesFactory.SetCacheListener(listener);
         }
     }
     if (cacheLoader != null)
     {
         attributesFactory.SetCacheLoader(cacheLoader);
     }
     if (cacheWriter != null)
     {
         attributesFactory.SetCacheWriter(cacheWriter);
     }
 }