Exemple #1
0
        public SessionsManager(
            BlockingCollection <string> notificationRequests,
            BlockingCollection <string> notificationRemoveRequests, BlockingCollection <FeedMessage[]> feedMessagesLog, dsMonitor dsmonitor)

        {
            try
            {
                m_NotificationRequests = notificationRequests;

                m_NotificationRemoveRequests = notificationRemoveRequests;
                m_FeedMessagesLog            = feedMessagesLog;

                m_dsMonitor = dsmonitor;

                m_dictionaryClientSessions    = new ConcurrentDictionary <string, ClientSession>();
                this.UpdatesFeedMessagesQueue = new ConcurrentQueue <FeedMessage>();

                // m_SnapShotManager = snapshotMgr;

                // m_configCash = configcash;

                taskHandleFeedMsgsUpdates = Task.Factory.StartNew(() => HandleFeedMessagesUpdates());
            }
            catch (Exception exp)
            {
                m_NLog.Error("Error in SessionsManager Constructor Error Details : {0}", exp.ToString());
            }
        }
        public frmMonitor(dsMonitor dsmonitor)
        {
            InitializeComponent();


            m_dsMonitor = dsmonitor;//view notificaion msgs and subscriptions.

            ultraGridActiveSubscriptions.DataSource  = m_dsMonitor.Subscription_Items;
            ultraGridSentNotificaions.DataSource     = m_dsMonitor.SentNotificaions;
            ultraGridReceivedNotificaions.DataSource = m_dsMonitor.ReceivedNotificaions;
        }
Exemple #3
0
 public NotificationLogHandler(BlockingCollection <NotificationMessage> notificationsMessages, BlockingCollection <FeedMessage[]> feedMessages, dsMonitor dsmonitor)
 {
     try
     {
         m_AppLogger = LogManager.GetLogger("AppLogger");
         m_ReceivedNotificationLogger = LogManager.GetLogger("NotificaionsLogger");
         m_OutgoingMessagesLogger     = LogManager.GetLogger("OutgoingMessagesLogger");
         m_NotificationsMessages      = notificationsMessages;
         m_FeedMessages = feedMessages;
         m_dsMonitor    = dsmonitor;
     }
     catch (Exception exp)
     {
         Console.WriteLine("Error in NotificationLogHandler Constructor. Error Details : {0} ", exp);
     }
 }
        private void StartService()
        {
            try
            {
                m_NLog = LogManager.GetLogger("AppLogger");
                m_NLog.Info("Starting Notification Provider.");

                m_NotificationRequests       = new BlockingCollection <string>();
                m_NotificationMessages       = new BlockingCollection <NotificationMessage>();
                m_NotificationMessagesLog    = new BlockingCollection <NotificationMessage>();
                m_NotificationRemoveRequests = new BlockingCollection <string>();
                m_FeedMessagesLog            = new BlockingCollection <FeedMessage[]>();

                m_dsMonitor = new dsMonitor();

                //Start NotificationEngine proxy handler.
                m_NotificaionEngineProxy = new NotificaionEngineProxy(m_NotificationRequests, m_NotificationMessages,
                                                                      m_NotificationMessagesLog, m_NotificationRemoveRequests);
                m_NotificaionEngineProxy.Initialize();
                m_NotificaionEngineProxy.ConnectToNotificationEngine();  // subscribe to Notificaion Engine.


                #region Sessions Management
                m_SessionManager = new SessionsManager(m_NotificationRequests, m_NotificationRemoveRequests, m_FeedMessagesLog, m_dsMonitor);
                #endregion

                #region Initialize Router
                m_Router = new Router(m_SessionManager);
                #endregion

                #region Start Process Received Feed
                m_FeedProcessor = new FeedProcessor(m_NotificationMessages, m_Router);
                m_FeedProcessor.StartHanldeReceivedFeed();
                #endregion

                #region Logs
                if (bool.Parse(System.Configuration.ConfigurationManager.AppSettings["LogNotificationMsgs"]))
                {
                    m_NotificaionLogHandler = new NotificationLogHandler(m_NotificationMessagesLog, m_FeedMessagesLog, m_dsMonitor);;
                    m_NotificaionLogHandler.StartLogging();
                }

                #endregion


                #region test
                //  Test
                //  m_NotificationRequests.Add("Notify_User#1248");

                //Task.Factory.StartNew(() =>
                //{
                //    TestFeed();
                //});
                #endregion

                #region Start  Wcf Service
                try
                {
                    m_FeedService = new FeedService(m_SessionManager);
                    serviceHost   = new ServiceHost(m_FeedService);
                    serviceHost.Open();
                    Console.BackgroundColor = ConsoleColor.Yellow;
                    m_NLog.Info("Notification Provider Service started and ready to handle dataAdapters requests.");
                    Console.ResetColor();
                }
                catch (Exception exp)
                {
                    m_NLog.Error("Error in Start Notification Provider Service(). Error Details : {0}", exp.ToString());
                }
                #endregion
            }
            catch (Exception exp)
            {
                m_NLog.Error("Error in Service Startup. Error Details : ", exp.ToString());
            }
        }