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(); } }
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); } } }
private static void SetAssignedConfig(ReflectInsightConfig config) { lock (Lockobject) { FAssignedConfig = config ?? FDefaultConfig; FAssignedConfig.ConstructSubsections(); RIEventManager.DoOnConfigSettingsInitialized(FAssignedConfig); } }
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()"); } }
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()"); } }
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; } }
public void ForceConfigChange() { RIEventManager.DoOnConfigChange(); }