Esempio n. 1
0
        protected ArribaApplication(DatabaseFactory factory, ClaimsAuthenticationService claimsAuth)
        {
            this.EventSource = EventPublisher.CreateEventSource(this.GetType().Name);
            this.Database    = factory.GetDatabase();
            _claimsAuth      = claimsAuth;

            // Cache correctors which aren't request specific
            // Cache the People table so that it isn't reloaded for every request.
            // TODO: Need to make configurable by table.
            _correctors = new ComposedCorrector(new TodayCorrector(), new UserAliasCorrector(this.Database["People"]));
        }
Esempio n. 2
0
        public RequestContext(IRequest request)
        {
            MonitorEventEntry defaults = new MonitorEventEntry()
            {
                Level  = MonitorEventLevel.Verbose,
                Source = "HTTP",
                User   = request.User.Identity.Name,
                Detail = null
            };

            _request     = request;
            _eventSource = EventPublisher.CreateEventSource(defaults);
        }
Esempio n. 3
0
        public void MonitorPublisherScopedEventSource()
        {
            var c = new TestMonitorEventConsumer(MonitorEventLevel.All, MonitorEventOpCode.All);

            List <MonitorEventEntry> items = new List <MonitorEventEntry>();
            bool eventRaised = false;

            c.OnEventAction = (e) =>
            {
                Assert.AreEqual("MySource", e.Source);
                Assert.AreEqual("test", e.Name);
                eventRaised = true;
            };

            using (EventPublisher.AddConsumer(c))
            {
                var source = EventPublisher.CreateEventSource("MySource");

                source.Raise(name: "test");
            }

            Assert.IsTrue(eventRaised);
        }