Exemple #1
0
        public override void MatchEvent(EventBean theEvent, ICollection <FilterHandle> matches)
        {
            var attributeValue = Lookupable.Getter.Get(theEvent);
            var returnValue    = new Mutable <bool>(false);

            using (Instrument.With(
                       i => i.QFilterReverseIndex(this, attributeValue),
                       i => i.AFilterReverseIndex(returnValue.Value)))
            {
                EventEvaluator evaluator = null;
                using (ConstantsMapRwLock.AcquireReadLock())
                {
                    evaluator = ConstantsMap.Get(attributeValue);
                }

                // No listener found for the value, return
                if (evaluator == null)
                {
                    returnValue.Value = false;
                }
                else
                {
                    evaluator.MatchEvent(theEvent, matches);
                    returnValue.Value = true;
                }
            }
        }
Exemple #2
0
        public override void MatchEvent(
            EventBean theEvent,
            ICollection<FilterHandle> matches,
            ExprEvaluatorContext ctx)
        {
            object attributeValue = Lookupable.Eval.Eval(theEvent, ctx);
            if (InstrumentationHelper.ENABLED) {
                InstrumentationHelper.Get().QFilterReverseIndex(this, attributeValue);
            }

            EventEvaluator evaluator = null;
            using (ConstantsMapRwLock.ReadLock.Acquire()) {
                evaluator = ConstantsMap.Get(attributeValue);
            }

            // No listener found for the value, return
            if (evaluator == null) {
                if (InstrumentationHelper.ENABLED) {
                    InstrumentationHelper.Get().AFilterReverseIndex(false);
                }

                return;
            }

            if (InstrumentationHelper.ENABLED) {
                InstrumentationHelper.Get().AFilterReverseIndex(true);
            }

            evaluator.MatchEvent(theEvent, matches, ctx);
        }