Example #1
0
        public override void GetContent(HandleContentDelegate handleContentDelegate)
        {
            CheckNotDisposed();
            CacheHashMap keyToInstanceMap = new CacheHashMap(CacheMapEntryTypeProvider);
            Lock         writeLock        = this.WriteLock;

            writeLock.Lock();
            try
            {
                foreach (CacheMapEntry entry in keyToCacheValueDict)
                {
                    Object cacheValue = GetCacheValueFromReference(entry.GetValue());
                    if (cacheValue == null)
                    {
                        continue;
                    }
                    keyToInstanceMap.Put(entry.EntityType, entry.IdIndex, entry.Id, cacheValue);
                }
                foreach (CacheMapEntry entry in keyToInstanceMap)
                {
                    sbyte idIndex = entry.IdIndex;
                    if (idIndex == ObjRef.PRIMARY_KEY_INDEX)
                    {
                        handleContentDelegate(entry.EntityType, idIndex, entry.Id, entry.GetValue());
                    }
                }
            }
            finally
            {
                writeLock.Unlock();
            }
        }
Example #2
0
        public override void AfterPropertiesSet()
        {
            base.AfterPropertiesSet();

            keyToAlternateIdsMap = new CacheHashMap(CacheMapEntryTypeProvider);

            gcProxy = GarbageProxyFactory.CreateGarbageProxy <ICacheIntern>(this, (IDisposable)null, typeof(IWritableCache));
        }
Example #3
0
 public override void Dispose()
 {
     if (CacheId != 0)
     {
         FirstLevelCacheExtendable.UnregisterFirstLevelCache(this, CacheFactoryDirective.NoDCE, false, Name);
     }
     CacheModification         = null;
     CachePathHelper           = null;
     EntityFactory             = null;
     FirstLevelCacheExtendable = null;
     GarbageProxyFactory       = null;
     Log    = null;
     Parent = null;
     keyToAlternateIdsMap = null;
     SecurityActivation   = null;
     base.Dispose();
 }