Пример #1
0
        /// <summary>Evaluate an event by asking each index to match the event. Any filter callbacks at this node automatically match the event and do not need to be further evaluated, and are thus added to the "matches" list of callbacks. NOTE: This client should not use the lock before calling this method. </summary>
        /// <param name="theEvent">is the event wrapper supplying the event property values</param>
        /// <param name="matches">is the list of callbacks to add to for any matches found</param>
        /// <param name="ctx">evaluator context</param>
        public void MatchEvent(
            EventBean theEvent,
            ICollection <FilterHandle> matches,
            ExprEvaluatorContext ctx)
        {
            using (_nodeRwLock.AcquireReadLock())
            {
                if (InstrumentationHelper.ENABLED)
                {
                    if (_indizes.IsNotEmpty())
                    {
                        InstrumentationHelper.Get().QFilterHandleSetIndexes(_indizes);
                    }
                }

                // Ask each of the indizes to match against the attribute values
                var length = _indizes.Count;
                for (int ii = 0; ii < length; ii++)
                {
                    _indizes[ii].MatchEvent(theEvent, matches, ctx);
                }

                if (InstrumentationHelper.ENABLED)
                {
                    if (_indizes.IsNotEmpty())
                    {
                        InstrumentationHelper.Get().AFilterHandleSetIndexes();
                    }
                }

                if (InstrumentationHelper.ENABLED)
                {
                    if (_callbackSet.IsNotEmpty())
                    {
                        InstrumentationHelper.Get().QaFilterHandleSetCallbacks(_callbackSet);
                    }
                }

                // Add each filter callback stored in this node to the matching list
                _callbackSet.AddTo(matches);

                //foreach (FilterHandle filterCallback in _callbackSet)
                //{
                //    matches.Add(filterCallback);
                //}
            }
        }