コード例 #1
0
        static private void OnShutdown()
        {
            try
            {
                AppDomain.CurrentDomain.ProcessExit -= OnShutdown;
                RIEventManager.OnConfigChange       -= OnConfigFileChange;

                RIEventManager.DoOnShutdown();
                ReflectInsight.OnShutdown();
                DebugManager.OnShutdown();
                RIMessageColors.OnShutdown();
                RILogManager.OnShutdown();
                RIListenerGroupManager.OnShutdown();
                ReflectInsightConfig.OnShutdown();
                TraceMethod.OnShutdown();

                RITraceListener.OnShutdown();
            }
            catch (Exception ex)
            {
                RIExceptionManager.Publish(ex, "Failed during: static ReflectInsightService.OnShutdown()");
            }
            finally
            {
                RIExceptionManager.OnShutdown();
                DebugTextLoggerManager.OnShutdown();
            }
        }
コード例 #2
0
        static private void SendPackages(DestinationInfo[] destinations)
        {
            foreach (DestinationInfo dInfo in destinations)
            {
                try
                {
                    ReflectInsightPackage[] messages = dInfo.GetInterimMessages();
                    if (messages.Length > 0)
                    {
                        try
                        {
                            InvokeListeners.Receive(dInfo, dInfo.GetInterimMessages());
                        }
                        finally
                        {
                            dInfo.ClearInterimMessageQueue();
                            DebugManager.Sleep(0);
                        }
                    }
                }
                catch (ThreadAbortException)
                {
                }
                catch (Exception ex)
                {
                    if (RIExceptionManager.CanEvent(ex))
                    {
                        RIExceptionManager.Publish(new ReflectInsightException(String.Format("MessageManager.InvokeListeners: unhandled exception was detected in destination message loop for destination: {0}", dInfo.Name), ex));
                    }

                    RIEventManager.DoOnQueueException(ex);
                }
            }
        }
コード例 #3
0
 private static void SetAssignedConfig(ReflectInsightConfig config)
 {
     lock (Lockobject)
     {
         FAssignedConfig = config ?? FDefaultConfig;
         FAssignedConfig.ConstructSubsections();
         RIEventManager.DoOnConfigSettingsInitialized(FAssignedConfig);
     }
 }
コード例 #4
0
 static private void OnConfigFileChange()
 {
     try
     {
         lock (FLockObject)
         {
             RIExceptionManager.OnConfigFileChange();
             MessageQueue.OnConfigFileChange();
             MessageManager.OnConfigFileChange();
             RIListenerGroupManager.OnConfigFileChange();
             RILogManager.OnConfigFileChange();
             RIMessageColors.OnConfigFileChange();
             TraceMethod.OnConfigFileChange();
             ReflectInsight.OnConfigFileChange();
             RIEventManager.DoOnServiceConfigChange();
         }
     }
     catch (Exception ex)
     {
         RIExceptionManager.Publish(ex, "Failed during: static ReflectInsightService.OnConfigFileChange()");
     }
 }
コード例 #5
0
        static private void OnStartup()
        {
            try
            {
                RIExceptionManager.OnStartup();
                MessageQueue.OnStartup();
                MessageManager.OnStartup();
                RIListenerGroupManager.OnStartup();
                DebugManager.OnStartup();
                RILogManager.OnStartup();
                RIMessageColors.OnStartup();
                TraceMethod.OnStartup();
                ReflectInsight.OnStartup();
                RIEventManager.DoOnStartup();

                RITraceListener.OnStartup();
            }
            catch (Exception ex)
            {
                RIExceptionManager.Publish(ex, "Failed during: static ReflectInsightService.OnStartup()");
            }
        }
コード例 #6
0
        static private void ExecuteProcessMessages()
        {
            try
            {
                while (true)
                {
                    Thread.Sleep(FSleep);

                    ProcessMessages();

                    if (DebugManager.DebugMessageProcessEnabled)
                    {
                        continue;
                    }

                    lock (FLockObject)
                    {
                        if (!MessageQueue.HasMessages)
                        {
                            break;
                        }
                    }

                    Thread.Sleep(FSleep);
                }
            }
            catch (ThreadAbortException)
            {
            }
            catch (Exception ex)
            {
                RIExceptionManager.PublishIfEvented(new ReflectInsightException("MessageManager.ExecuteProcessMessages detected an unhandled exception. Please see inner exception for more details.", ex));
                RIEventManager.DoOnQueueException(ex);
            }
            finally
            {
                IsProcessing = false;
            }
        }
コード例 #7
0
 public void ForceConfigChange()
 {
     RIEventManager.DoOnConfigChange();
 }