Exemple #1
0
        public void SaveEnumerationMethodLastValue(Object node, Object result)
        {
            var snapshot = _lastValueCacheStack.ToArray();
            var entry    = new ExpressionResultCacheEntry <long[], Object>(snapshot, result);

            _enumMethodCache.Put(node, new compat.WeakReference <ExpressionResultCacheEntry <long[], Object> >(entry));
        }
Exemple #2
0
        public ExpressionResultCacheEntry <long[], Object> GetEnumerationMethodLastValue(Object node)
        {
            InitEnumMethodCache();
            var cacheRef = _enumMethodCache.Get(node);

            if (cacheRef == null)
            {
                return(null);
            }
            ExpressionResultCacheEntry <long[], Object> entry = cacheRef.Target;

            if (entry == null)
            {
                return(null);
            }
            long[] required = entry.Reference;
            if (required.Length != _lastValueCacheStack.Count)
            {
                return(null);
            }
            IEnumerator <long> prov = _lastValueCacheStack.GetEnumerator();

            for (int i = 0; i < _lastValueCacheStack.Count; i++)
            {
                prov.MoveNext();
                if (!required[i].Equals(prov.Current))
                {
                    return(null);
                }
            }
            return(entry);
        }
        public void SaveEnumerationMethodLastValue(object node, object result)
        {
            long?[] snapshot = lastValueCacheStack.ToArray();
            var     entry    = new ExpressionResultCacheEntry <long?[], object>(snapshot, result);

            enumMethodCache.Put(node, new SoftReference <ExpressionResultCacheEntry <long?[], object> >(entry));
        }
        public void SaveDeclaredExpressionLastValue(object node, EventBean[] eventsPerStream, object result)
        {
            EventBean[] copy  = EventBeanUtility.CopyArray(eventsPerStream);
            var         entry = new ExpressionResultCacheEntry <EventBean[], object>(copy, result);

            _exprDeclCacheObject.Put(node, new SoftReference <ExpressionResultCacheEntry <EventBean[], object> >(entry));
        }
        public void SaveDeclaredExpressionLastColl(object node, EventBean[] eventsPerStream, ICollection <EventBean> result)
        {
            var copy  = eventsPerStream.MaterializeArray();
            var entry = new ExpressionResultCacheEntry <EventBean[], ICollection <EventBean> >(copy, result);

            _exprDeclCacheCollection.Put(
                node, new SoftReference <ExpressionResultCacheEntry <EventBean[], ICollection <EventBean> > >(entry));
        }
Exemple #6
0
        public void SaveDeclaredExpressionLastColl(Object node, EventBean[] eventsPerStream, ICollection <EventBean> result)
        {
            var copy = new EventBean[eventsPerStream.Length];

            Array.Copy(eventsPerStream, 0, copy, 0, copy.Length);
            var entry = new ExpressionResultCacheEntry <EventBean[], ICollection <EventBean> >(copy, result);

            _exprDeclCacheCollection.Put(node, new compat.WeakReference <ExpressionResultCacheEntry <EventBean[], ICollection <EventBean> > >(entry));
        }
Exemple #7
0
        public void SavePropertyColl(
            string propertyNameFullyQualified,
            EventBean reference,
            ICollection <EventBean> events)
        {
            var entry = new ExpressionResultCacheEntry <EventBean, ICollection <EventBean> >(reference, events);

            _collPropertyCache.Put(
                propertyNameFullyQualified,
                new SoftReference <ExpressionResultCacheEntry <EventBean, ICollection <EventBean> > >(entry));
        }