public static EventBasedAssistantCollection Create(DatabaseInfo databaseInfo, AssistantType[] assistantTypes)
        {
            EventBasedAssistantCollection eventBasedAssistantCollection = new EventBasedAssistantCollection(databaseInfo, assistantTypes);

            if (eventBasedAssistantCollection.Count == 0)
            {
                eventBasedAssistantCollection.Dispose();
                return(null);
            }
            return(eventBasedAssistantCollection);
        }
예제 #2
0
        // Token: 0x060001E0 RID: 480 RVA: 0x00009D48 File Offset: 0x00007F48
        public EventController(DatabaseInfo databaseInfo, EventBasedAssistantCollection assistants, PoisonEventControl poisonControl, PerformanceCountersPerDatabaseInstance databaseCounters, ThrottleGovernor serverGovernor, MapiEventTypeFlags moreEvents)
        {
            this.databaseInfo     = databaseInfo;
            this.databaseCounters = databaseCounters;
            this.assistants       = assistants;
            this.shutdownState    = 0;
            this.poisonControl    = poisonControl;
            MapiEventTypeFlags mapiEventTypeFlags = this.assistants.EventMask | moreEvents;

            this.filter      = (((MapiEventTypeFlags)(-1) == mapiEventTypeFlags) ? null : Restriction.BitMaskNonZero(PropTag.EventMask, (int)mapiEventTypeFlags));
            this.governor    = new DatabaseGovernor("event processing on '" + databaseInfo.DisplayName + "'", serverGovernor, new Throttle("EventDatabase", serverGovernor.Throttle.OpenThrottleValue, serverGovernor.Throttle));
            this.eventAccess = EventAccess.Create(this.DatabaseInfo, this.assistants);
        }
        internal static EventBasedAssistantCollection CreateForTest(DatabaseInfo databaseInfo, IEventBasedAssistantType[] eventBasedAssistantTypes)
        {
            PerformanceCountersPerAssistantInstance performanceCountersPerAssistantsTotal = new PerformanceCountersPerAssistantInstance("TestAssistant-Total", null);

            AssistantType[] assistantTypes = AssistantType.CreateArray(eventBasedAssistantTypes, performanceCountersPerAssistantsTotal);
            EventBasedAssistantCollection eventBasedAssistantCollection = new EventBasedAssistantCollection(databaseInfo, assistantTypes);

            if (eventBasedAssistantCollection.Count == 0)
            {
                eventBasedAssistantCollection.Dispose();
                return(null);
            }
            return(eventBasedAssistantCollection);
        }
 public EventControllerPrivate(DatabaseInfo databaseInfo, EventBasedAssistantCollection assistants, PoisonEventControl poisonControl, PerformanceCountersPerDatabaseInstance performanceCounters, ThrottleGovernor serverGovernor) : base(databaseInfo, assistants, poisonControl, performanceCounters, serverGovernor, MapiEventTypeFlags.MailboxDeleted | MapiEventTypeFlags.MailboxMoveSucceeded)
 {
 }
 // Token: 0x0600021E RID: 542 RVA: 0x0000C084 File Offset: 0x0000A284
 public EventControllerPublic(DatabaseInfo databaseInfo, EventBasedAssistantCollection assistants, PoisonEventControl poisonControl, PerformanceCountersPerDatabaseInstance databaseCounters, ThrottleGovernor serverGovernor) : base(databaseInfo, assistants, poisonControl, databaseCounters, serverGovernor, (MapiEventTypeFlags)0)
 {
     this.dispatcher = new EventDispatcherPublic(assistants.GetAssistantForPublicFolder(), this, base.Governor);
 }
예제 #6
0
 private EventAccess(DatabaseInfo databaseInfo, EventBasedAssistantCollection assistants)
 {
     this.databaseInfo        = databaseInfo;
     this.assistantCollection = assistants;
 }
예제 #7
0
 public static EventAccess Create(DatabaseInfo databaseInfo, EventBasedAssistantCollection assistants)
 {
     return(new EventAccess(databaseInfo, assistants));
 }
예제 #8
0
        public void Start()
        {
            ExTraceGlobals.OnlineDatabaseTracer.TraceDebug <OnlineDatabase>((long)this.GetHashCode(), "{0}: Starting", this);
            bool flag  = false;
            bool flag2 = false;
            bool flag3 = false;
            EventBasedAssistantCollection eventBasedAssistantCollection = null;

            try
            {
                PoisonEventControl   poisonControl  = new PoisonEventControl(this.databaseManager.PoisonControlMaster, this.DatabaseInfo);
                PoisonMailboxControl poisonControl2 = new PoisonMailboxControl(this.databaseManager.PoisonControlMaster, this.DatabaseInfo);
                string text = this.databaseManager.ServiceName + "-" + this.DatabaseInfo.DatabaseName;
                ExTraceGlobals.OnlineDatabaseTracer.TraceDebug <OnlineDatabase, string>((long)this.GetHashCode(), "{0}: Creating performance counters instance {1}", this, text);
                this.performanceCounters = new PerformanceCountersPerDatabaseInstance(text, this.databaseManager.PerformanceCountersTotal);
                this.performanceCounters.Reset();
                if (this.databaseManager.AssistantTypes != null)
                {
                    eventBasedAssistantCollection = EventBasedAssistantCollection.Create(this.databaseInfo, this.databaseManager.AssistantTypes);
                    if (eventBasedAssistantCollection != null)
                    {
                        if (this.databaseInfo.IsPublic)
                        {
                            this.eventController = new EventControllerPublic(this.databaseInfo, eventBasedAssistantCollection, poisonControl, this.performanceCounters, this.databaseManager.EventGovernor);
                        }
                        else
                        {
                            this.eventController = new EventControllerPrivate(this.databaseInfo, eventBasedAssistantCollection, poisonControl, this.performanceCounters, this.databaseManager.EventGovernor);
                        }
                        eventBasedAssistantCollection = null;
                        this.eventController.Start();
                        flag2 = true;
                    }
                }
                if (!this.databaseInfo.IsPublic && this.databaseManager.TimeBasedDriverManager != null)
                {
                    this.databaseManager.TimeBasedDriverManager.StartDatabase(this.databaseInfo, poisonControl2, this.performanceCounters);
                    flag3 = true;
                }
                flag = true;
            }
            finally
            {
                if (eventBasedAssistantCollection != null)
                {
                    eventBasedAssistantCollection.Dispose();
                }
                if (!flag)
                {
                    ExTraceGlobals.OnlineDatabaseTracer.TraceError <OnlineDatabase>((long)this.GetHashCode(), "{0}: unable to start", this);
                    if (this.eventController != null)
                    {
                        if (flag2)
                        {
                            this.eventController.Stop();
                        }
                        this.eventController.Dispose();
                        this.eventController = null;
                    }
                }
                if (!flag3 && !flag2)
                {
                    this.DisposePerformanceCounters();
                }
            }
            base.TracePfd("PFS AIS {0} {1}: Started", new object[]
            {
                20567,
                this
            });
        }