Exemple #1
0
        public IList <Object> GetObjects(IList <IObjRef> orisToGet, ICacheIntern targetCache, CacheDirective cacheDirective)
        {
            CheckNotDisposed();
            if (orisToGet == null || orisToGet.Count == 0)
            {
                return(new List <Object>(0));
            }
            IEventQueue eventQueue = EventQueue;

            if (eventQueue != null)
            {
                eventQueue.Pause(this);
            }
            try
            {
                bool oldCacheModificationValue = CacheModification.Active;
                bool acquireSuccess            = AcquireHardRefTLIfNotAlready(orisToGet.Count);
                CacheModification.Active = true;
                try
                {
                    if (cacheDirective.HasFlag(CacheDirective.LoadContainerResult) || cacheDirective.HasFlag(CacheDirective.CacheValueResult))
                    {
                        return(Parent.GetObjects(orisToGet, this, cacheDirective));
                    }
                    bool doAnotherRetry;
                    while (true)
                    {
                        doAnotherRetry = false;
                        IList <Object> result = GetObjectsRetry(orisToGet, cacheDirective, out doAnotherRetry);
                        if (!doAnotherRetry)
                        {
                            return(result);
                        }
                    }
                }
                finally
                {
                    CacheModification.Active = oldCacheModificationValue;
                    ClearHardRefs(acquireSuccess);
                }
            }
            finally
            {
                if (eventQueue != null)
                {
                    eventQueue.Resume(this);
                }
            }
        }
Exemple #2
0
        public IList <IObjRelationResult> GetObjRelations(IList <IObjRelation> objRels, ICacheIntern targetCache, CacheDirective cacheDirective)
        {
            CheckNotDisposed();
            IEventQueue eventQueue = EventQueue;

            if (eventQueue != null)
            {
                eventQueue.Pause(this);
            }
            try
            {
                bool oldCacheModificationValue = CacheModification.Active;
                bool acquireSuccess            = AcquireHardRefTLIfNotAlready(objRels.Count);
                CacheModification.Active = true;
                try
                {
                    if (SecurityActive && ((targetCache == null && Privileged) || (targetCache != null && targetCache.Privileged) &&                 //
                                           SecurityActivation != null && SecurityActivation.FilterActivated))
                    {
                        return(SecurityActivation.ExecuteWithoutFiltering(delegate()
                        {
                            return Parent.GetObjRelations(objRels, targetCache, cacheDirective);
                        }));
                    }
                    else
                    {
                        return(Parent.GetObjRelations(objRels, targetCache, cacheDirective));
                    }
                }
                finally
                {
                    CacheModification.Active = oldCacheModificationValue;
                    ClearHardRefs(acquireSuccess);
                }
            }
            finally
            {
                if (eventQueue != null)
                {
                    eventQueue.Resume(this);
                }
            }
        }