Esempio n. 1
0
        private void SetupRegion(uint entryTTL, uint entryIdleTimeout,
                                 uint regionTTL, uint regionIdleTimeout)
        {
            const ExpirationAction action = ExpirationAction.Destroy;

            RegionFactory rf = CacheHelper.DCache.CreateRegionFactory(RegionShortcut.LOCAL);

            rf.SetEntryTimeToLive(action, entryTTL);
            rf.SetEntryIdleTimeout(action, entryIdleTimeout);
            rf.SetRegionTimeToLive(action, regionTTL);
            rf.SetRegionIdleTimeout(action, regionIdleTimeout);

            CacheHelper.Init();
            IRegion <object, object> region = CacheHelper.GetRegion <object, object>(m_regionName);

            if ((region != null) && !region.IsDestroyed)
            {
                region.GetLocalView().DestroyRegion();
                Assert.IsTrue(region.IsDestroyed, "IRegion<object, object> {0} was not destroyed.", m_regionName);
            }
            m_region = rf.Create <object, object>(m_regionName);
            Assert.IsNotNull(m_region, "IRegion<object, object> was not created.");
        }